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

The mod_deleted trigger is not triggered on AJAX requests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 2.0
    • Course
    • None
    • MOODLE_20_STABLE
    • Easy

      When deleting a resource from a topic using AJAX, the event mod_deleted is not triggered.

      To resolve this bug the following lines can be added to the file [moodle_root]/course/rest.php, within the case 'DELETE' on the bottom of subcase 'resource' just before the add_to_log($courseid, "course", "delete mod", "view.php?id=$courseid", "$cm->modname $cm->instance", $cm->id); line:

      // Trigger a mod_deleted event with information about this module.
      $eventdata = new stdClass();
      $eventdata->modulename = $cm->modname;
      $eventdata->cmid = $cm->id;
      $eventdata->courseid = $course->id;
      $eventdata->userid = $USER->id;

      events_trigger('mod_deleted', $eventdata);

      Thanks

            moodle.com Moodle HQ
            cesperanc@ Cláudio Esperança
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.