Commit 11bb1a8ffcce0c41da44ebacf420bb0da0901d72

Authored by Benjamin Renard
1 parent 6bfa699d

Fix #5379

Showing 1 changed file with 3 additions and 6 deletions   Show diff stats
php/classes/SharedObjectTreeFile.php
... ... @@ -143,12 +143,10 @@ class SharedObjectTreeFile {
143 143  
144 144 public function getFolderIdByObjectId($object_type, $object_id) {
145 145 $listNode = $this->getObjectListNode($object_type);
146   -
147 146 if (!isset($listNode))
148 147 return "";
149   -
  148 +
150 149 $folderNodes = $listNode->getElementsByTagName("folder");
151   -
152 150 foreach ($folderNodes as $folderNode) {
153 151 $nameAtt = $folderNode->getAttribute('name');
154 152 $idAtt = $folderNode->getAttribute('xml:id');
... ... @@ -158,11 +156,10 @@ class SharedObjectTreeFile {
158 156 $objectNodes = $folderNode->getElementsByTagName($object_type);
159 157  
160 158 foreach ($objectNodes as $objectNode) {
161   - if ($idAtt == $object_id)
  159 + if ($objectNode->getAttribute('xml:id') == $object_id)
162 160 return $idAtt;
163 161 }
164 162 }
165   -
166 163 return "";
167 164 }
168 165  
... ... @@ -286,4 +283,4 @@ class SharedObjectTreeFile {
286 283 }
287 284 }
288 285  
289   -?>
290 286 \ No newline at end of file
  287 +?>
... ...