Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions atom/cmis/cmis_repository_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,22 @@ static function extractObjectFromNode($xmlnode)
$prop_nodes = $xmlnode->getElementsByTagName("object")->item(0)->getElementsByTagName("properties")->item(0)->childNodes;
foreach ($prop_nodes as $pn)
{
if ($pn->attributes) {
//supressing errors since PHP sometimes sees DOM elements as "non-objects"
@$retval->properties[$pn->attributes->getNamedItem("propertyDefinitionId")->nodeValue] = $pn->getElementsByTagName("value")->item(0)->nodeValue;
}
if ($pn->attributes)
{
$propDefId = $pn->attributes->getNamedItem("propertyDefinitionId");
// TODO: Maybe use ->length=0 to even detect null values
if (!is_null($propDefId) && $pn->getElementsByTagName("value") && $pn->getElementsByTagName("value")->item(0))
{
if ($pn->getElementsByTagName("value")->length > 1) {
$retval->properties[$propDefId->nodeValue] = array();
for ($idx=0;$idx < $pn->getElementsByTagName("value")->length;$idx++) {
$retval->properties[$propDefId->nodeValue][$idx] = $pn->getElementsByTagName("value")->item($idx)->nodeValue;
}
} else {
$retval->properties[$propDefId->nodeValue] = $pn->getElementsByTagName("value")->item(0)->nodeValue;
}
}
}
}

$retval->uuid = $xmlnode->getElementsByTagName("id")->item(0)->nodeValue;
Expand Down
13 changes: 7 additions & 6 deletions atom/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<package version="1.0">
<name>cmis-phplib</name>
<name>cmis</name>
<summary>PHP Atom Pub CMIS client</summary>
<description>
This is a PHP CMIS client library that uses the Atom Pub Binding
Expand All @@ -16,17 +16,18 @@
</maintainers>

<release>
<version>0.2.0</version>
<date>2013-11-20</date>
<state>stable</state>
<version>0.2.0ignos</version>
<date>2016-09-29</date>
<license>Apache License</license>
<state>beta</state>
<notes>
This is the first published release.
This release fixes a regression bug that avoids you to access multivalued properties.
</notes>
<filelist>
<dir name="/" baseinstalldir="cmis-lib">
<file role="php" name="cmis-lib.php" />
</dir>
<dir name="/cmis" baseinstalldir="cmis-lib/cmis">
<dir name="/cmis" baseinstalldir="cmis-lib">
<file role="php" name="cmis_repository_wrapper.php" />
<file role="php" name="cmis_service.php" />
</dir>
Expand Down