mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Issue #73 - Could not reproduce the issue but this fix should work.
- Added a fixed timestamp to get both planned/past outages, unlikely to happen outsite debugging environment but it could have a timing problem when fetching each list of outages. - Changed the query to get ended queries to be a the conditions of NOT a past outage. I believe the old query was equivalent but that should rule out a query problem.
This commit is contained in:
@@ -256,7 +256,7 @@ class outagedb {
|
||||
|
||||
$rs = $DB->get_recordset_select(
|
||||
'auth_outage',
|
||||
':datetime1 >= stoptime OR (finished IS NOT NULL AND :datetime2 >= finished)',
|
||||
'NOT (:datetime1 < stoptime AND (finished IS NULL OR :datetime2 < finished))',
|
||||
['datetime1' => $time, 'datetime2' => $time],
|
||||
'stoptime DESC, starttime DESC, title ASC',
|
||||
'*');
|
||||
|
||||
@@ -34,9 +34,12 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Give it a consistent time so all outages are listed. Useful when debugging.
|
||||
$now = time();
|
||||
|
||||
renderer::get()->output_view('manage.php', [
|
||||
'unended' => outagedb::get_all_unended(),
|
||||
'ended' => outagedb::get_all_ended(),
|
||||
'unended' => outagedb::get_all_unended($now),
|
||||
'ended' => outagedb::get_all_ended($now),
|
||||
]);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
Reference in New Issue
Block a user