-
Improvement
-
Resolution: Won't Fix
-
Minor
-
None
-
2.9
My patch in MDL-34867 included fixes to improve the performance of downloading log data where the parameter $logextra was added to the restore_legacy() function in the event base class so that additional course and user data could be passed. This is being addressed as a separate issue as the peer review suggested.
The existing function restore() in the event base class also already accepts the $logextra argument. I've attached a patch for what these changes look like.
New changes in lib/classes/event/base.php:
* @param \stdClass $legacy
|
+ * @param array $logextra Additional properties of the log
|
* @return base
|
*/
|
- public static final function restore_legacy($legacy) {
|
+ public static final function restore_legacy($legacy, array $logextra) {
|
$classname = get_called_class();
|
/** @var base $event */
|
$event = new $classname();
|
@@ -463,7 +464,7 @@ abstract class base implements \IteratorAggregate {
|
$event->data['relateduserid'] = ($legacy->userid ? $legacy->userid : null);
|
$event->data['timecreated'] = $legacy->time;
|
|
- $event->logextra = array();
|
+ $event->logextra = $logextra;
|
Existing $extralog parameter in lib/classes/event/base.php
/**
|
* Restore event from existing historic data.
|
*
|
* @param array $data
|
* @param array $logextra the format is standardised by logging API
|
* @return bool|\core\event\base
|
*/
|
public static final function restore(array $data, array $logextra) {
|
- has been marked as being related by
-
MDL-34867 Improve course log export resource consumption and reliability
-
- Closed
-