Skip to content

Commit

Permalink
Fix array merge exception on return from get_user_events_all
Browse files Browse the repository at this point in the history
function was returning a database record causing exception on array_merge
  • Loading branch information
catalyst-marcus-green committed Nov 23, 2023
1 parent 7a4959f commit 98aeb0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion classes/frequency.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion history.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 98aeb0e

Please sign in to comment.