mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 16:40:07 +01:00
MDL-40907 events: Allow one event write several entries to the legacy log table
This commit is contained in:
parent
515fe565f6
commit
c3ba899abd
@ -615,7 +615,14 @@ abstract class base implements \IteratorAggregate {
|
||||
if ($data = $this->get_legacy_logdata()) {
|
||||
$manager = get_log_manager();
|
||||
if (method_exists($manager, 'legacy_add_to_log')) {
|
||||
call_user_func_array(array($manager, 'legacy_add_to_log'), $data);
|
||||
if (is_array($data[0])) {
|
||||
// Some events require several entries in 'log' table.
|
||||
foreach ($data as $d) {
|
||||
call_user_func_array(array($manager, 'legacy_add_to_log'), $d);
|
||||
}
|
||||
} else {
|
||||
call_user_func_array(array($manager, 'legacy_add_to_log'), $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user