MDL-40907 events: Allow one event write several entries to the legacy log table

This commit is contained in:
Marina Glancy
2014-04-08 13:44:57 +08:00
parent 515fe565f6
commit c3ba899abd
+8 -1
View File
@@ -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);
}
}
}
}