MDL-23839 navigation: fixed php5.5ism
authorSam Hemelryk <sam@moodle.com>
Tue, 25 Nov 2014 01:35:30 +0000 (14:35 +1300)
committerSam Hemelryk <sam@moodle.com>
Tue, 25 Nov 2014 01:35:30 +0000 (14:35 +1300)
lib/navigationlib.php

index 0f431d4..3a53d86 100644 (file)
@@ -4419,7 +4419,8 @@ class settings_navigation extends navigation_node {
         }
 
         // Assign local roles
-        if (!empty(get_assignable_roles($catcontext))) {
+        $assignableroles = get_assignable_roles($catcontext);
+        if (!empty($assignableroles)) {
             $assignurl = new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $catcontext->id));
             $categorynode->add(get_string('assignroles', 'role'), $assignurl, self::TYPE_SETTING, null, 'roles', new pix_icon('i/assignroles', ''));
         }