Merge branch 'wip-MDL-21097-m23' of git://github.com/marinaglancy/moodle into MOODLE_...
[moodle.git] / lib / navigationlib.php
index 25e2c10..07eea13 100644 (file)
@@ -889,8 +889,9 @@ class navigation_node_collection implements IteratorAggregate {
         $child = $this->get($key, $type);
         if ($child !== false) {
             foreach ($this->collection as $colkey => $node) {
-                if ($node->key == $key && $node->type == $type) {
+                if ($node->key === $key && $node->type == $type) {
                     unset($this->collection[$colkey]);
+                    $this->collection = array_values($this->collection);
                     break;
                 }
             }