Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64944

Creating a mod_data entry triggers event twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.7
    • Fix Version/s: None
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      When you add a new mod_data entry via /mod/data/edit.php, the functions:

      • data_add_record()
      • data_add_fields_contents_to_new_record()
        are both called.

      Both of those functions trigger the \mod_data\event\record_created event, resulting in 2 log entries for a single record creation (as well as 2 emails, if a user subscribes using tool_monitor).

      I would suggest that the 2nd of these events is the correct one, as, by that point, the final data has been added to the record, but I'm not sure if there is anything that would be broken if data_add_record() did not trigger an event.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              davosmith Davo Smith
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: