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