From 98aeb0efca708dc14c05b89354eae9fe4c54faaa Mon Sep 17 00:00:00 2001 From: Marcus Green Date: Mon, 20 Nov 2023 13:53:20 +0000 Subject: [PATCH] Fix array merge exception on return from get_user_events_all function was returning a database record causing exception on array_merge --- classes/frequency.php | 5 ++++- history.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/frequency.php b/classes/frequency.php index 30444d7..4ed8939 100644 --- a/classes/frequency.php +++ b/classes/frequency.php @@ -1219,7 +1219,10 @@ public function get_frequency_array(int $year, string $metric, array $modules) : } else { // Work through the event array. foreach ($modules as $module) { - $events = array_merge($events, $this->$functionname($module, $from, $to)); + $records = $this->$functionname($module, $from, $to); + foreach ($records as $record) { + $events[] = $record; + } } } diff --git a/history.php b/history.php index dea15cb..beb7e59 100644 --- a/history.php +++ b/history.php @@ -49,7 +49,7 @@ $actionurl = new moodle_url('/local/assessfreq/history.php', array('action' => 'confirmed')); $cancelurl = new moodle_url('/local/assessfreq/history.php'); echo $OUTPUT->confirm(get_string('confirmreprocess', 'local_assessfreq'), - new single_button($actionurl, get_string('continue'), 'post', true), + new single_button($actionurl, get_string('continue'), 'post', single_button::BUTTON_SECONDARY), new single_button($cancelurl, get_string('cancel'), 'get')); } else if ($action == 'confirmed') {