MDL-61513 admin: Fix undefined $buttons variable
authorJun Pataleta <jun@moodle.com>
Thu, 22 Feb 2018 02:22:06 +0000 (10:22 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 22 Feb 2018 02:22:06 +0000 (10:22 +0800)
admin/category.php

index c87022b..f15fafb 100644 (file)
@@ -75,7 +75,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
 if ($PAGE->user_allowed_editing() && $adminediting != -1) {
     $USER->editing = $adminediting;
 }
-
+$buttons = null;
 if ($PAGE->user_allowed_editing()) {
     $url = clone($PAGE->url);
     if ($PAGE->user_is_editing()) {
@@ -129,7 +129,9 @@ if ($savebutton) {
 $visiblepathtosection = array_reverse($settingspage->visiblepath);
 $PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
 $PAGE->set_heading($SITE->fullname);
-$PAGE->set_button($buttons);
+if ($buttons) {
+    $PAGE->set_button($buttons);
+}
 
 echo $OUTPUT->header();