From c8a14cb8baf11f9e823b01016af34595d8901bb5 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 7 Aug 2019 10:08:20 +0800 Subject: [PATCH] MDL-65507 mod_data: Remove unnecessary record created event --- mod/data/locallib.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/mod/data/locallib.php b/mod/data/locallib.php index db8a7791c1c..b8bad674fcd 100644 --- a/mod/data/locallib.php +++ b/mod/data/locallib.php @@ -1421,6 +1421,7 @@ function data_approve_entry($entryid, $approve) { /** * Populate the field contents of a new record with the submitted data. + * An event has been previously triggered upon the creation of the new record in data_add_record(). * * @param stdClass $data database object * @param stdClass $context context object @@ -1449,18 +1450,6 @@ function data_add_fields_contents_to_new_record($data, $context, $recordid, $fie foreach ($processeddata->fields as $fieldname => $field) { $field->update_content($recordid, $datarecord->$fieldname, $fieldname); } - - // Trigger an event for updating this record. - $event = \mod_data\event\record_created::create(array( - 'objectid' => $recordid, - 'context' => $context, - 'courseid' => $data->course, - 'other' => array( - 'dataid' => $data->id - ) - )); - $event->add_record_snapshot('data', $data); - $event->trigger(); } /**