Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

MDL-27901 navigation: Notice when an admin node name is already used

  • Loading branch information...
commit 97a8edddf03877cae4f1529eb56128d240af06fe 1 parent 4bd6f71
@FMCorz FMCorz authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/adminlib.php
5 lib/adminlib.php
@@ -929,6 +929,11 @@ public function add($parentname, $something) {
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])) {
Please sign in to comment.
Something went wrong with that request. Please try again.