MDL-52160 navigation: Really remove module settings empty nodes
authorFrederic Massart <fred@moodle.com>
Mon, 16 Nov 2015 11:28:06 +0000 (19:28 +0800)
committerFrederic Massart <fred@moodle.com>
Mon, 16 Nov 2015 11:46:48 +0000 (19:46 +0800)
lib/navigationlib.php

index ae28067..ee029fe 100644 (file)
@@ -4032,8 +4032,8 @@ class settings_navigation extends navigation_node {
 
         $function($this, $modulenode);
 
-        // Remove the module node if there are no children
-        if (empty($modulenode->children)) {
+        // Remove the module node if there are no children.
+        if ($modulenode->children->count() <= 0) {
             $modulenode->remove();
         }