Merge branch 'MDL-27901-master' of git://github.com/FMCorz/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 8 Jan 2013 05:01:00 +0000 (13:01 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 8 Jan 2013 05:01:00 +0000 (13:01 +0800)
lib/adminlib.php

index 8994cd0..cb2e4f3 100644 (file)
@@ -932,6 +932,11 @@ class admin_category implements parentable_part_of_admin_tree {
                 debugging('error - parts of tree can be inserted only into parentable parts');
                 return false;
             }
+            if (debugging('', DEBUG_DEVELOPER) && !is_null($this->locate($something->name))) {
+                // The name of the node is already used, simply warn the developer that this should not happen.
+                // It is intentional to check for the debug level before performing the check.
+                debugging('Duplicate admin page name: ' . $something->name, DEBUG_DEVELOPER);
+            }
             $parent->children[] = $something;
             if (is_array($this->category_cache) and ($something instanceof admin_category)) {
                 if (isset($this->category_cache[$something->name])) {