From 6677ff2ea7475ae0ff75e0f19ea2fefe5e42ca0c Mon Sep 17 00:00:00 2001 From: Barry Oosthuizen Date: Thu, 3 Sep 2015 17:38:25 +0100 Subject: [PATCH] Fix #145 - hiding variable status items no longer working --- locallib.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/locallib.php b/locallib.php index 4ddf321..21c9b9d 100644 --- a/locallib.php +++ b/locallib.php @@ -1487,7 +1487,10 @@ class attendance { public function update_status($status, $acronym, $description, $grade, $visible) { global $DB; - if (empty($acronym) || empty($description)) { + if (isset($visible)) { + $status->visible = $visible; + $updated[] = $visible ? get_string('show') : get_string('hide'); + } else if (empty($acronym) || empty($description)) { return array('acronym' => $acronym, 'description' => $description); } @@ -1505,10 +1508,6 @@ class attendance { $status->grade = $grade; $updated[] = $grade; } - if (isset($visible)) { - $status->visible = $visible; - $updated[] = $visible ? get_string('show') : get_string('hide'); - } $DB->update_record('attendance_statuses', $status); $event = \mod_attendance\event\status_updated::create(array(