You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by ri...@apache.org on 2011/01/22 17:40:26 UTC

svn commit: r1062189 - /incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php

Author: richardm
Date: Sat Jan 22 16:40:26 2011
New Revision: 1062189

URL: http://svn.apache.org/viewvc?rev=1062189&view=rev
Log:
CMIS-290 extractObjectFromNode() returns object with null-keyed properties array
Added additional checks after further testing while working on drupal cmis module

Modified:
    incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php

Modified: incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php
URL: http://svn.apache.org/viewvc/incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php?rev=1062189&r1=1062188&r2=1062189&view=diff
==============================================================================
--- incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php (original)
+++ incubator/chemistry/phpclient/trunk/cmis_repository_wrapper.php Sat Jan 22 16:40:26 2011
@@ -383,7 +383,7 @@ class CMISRepositoryWrapper
             if ($pn->attributes)
             {
                 $propDefId = $pn->attributes->getNamedItem("propertyDefinitionId");
-                if (!is_null($propDefId))
+                if (!is_null($propDefId) && $pn->getElementsByTagName("value") && $pn->getElementsByTagName("value")->item(0))
                 {
                     $retval->properties[$propDefId->nodeValue] = $pn->getElementsByTagName("value")->item(0)->nodeValue;
                 }
@@ -399,7 +399,7 @@ class CMISRepositoryWrapper
         if (is_object($children_feed_c)) {
 			$children_feed_l = $children_feed_c->getElementsByTagName("feed");
         }
-        if (is_object($children_feed_l) && is_object($children_feed_l->item(0))) {
+        if (isset($children_feed_l) && is_object($children_feed_l) && is_object($children_feed_l->item(0))) {
         	$children_feed = $children_feed_l->item(0);
 			$children_doc = new DOMDocument();
 			$xnode = $children_doc->importNode($children_feed,true); // Avoid Wrong Document Error