diff --git a/locallib.php b/locallib.php index e6808c3..a2f37c9 100644 --- a/locallib.php +++ b/locallib.php @@ -1596,7 +1596,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); } @@ -1614,10 +1617,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(