Moodle
  1. Moodle
  2. MDL-29112

event mod_deleted is NOT triggered when delete mod through AJAX

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Course
    • Labels:
      None
    • Testing Instructions:
      Hide

      suitable for developers only:
      1/ create local plugin that handles the 'mod_deleted' event
      2/ verify it is triggered both via ajax and normal delete of activity

      Show
      suitable for developers only: 1/ create local plugin that handles the 'mod_deleted' event 2/ verify it is triggered both via ajax and normal delete of activity
    • Workaround:
      Hide

      See patch. The code is totally copied from course/mod.php

      Show
      See patch. The code is totally copied from course/mod.php
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Rank:
      18806

      Description

      When in editing mode and AJAX is enabled, clicking the delete mod icon will request course/rest.php. It does remove the mod properly but forgets to trigger mod_deleted event.

      Any other modules depend on this event will not work.

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Thanks for the report and patch!

          To integrators: please cherry pick to all 2.x branches

          Show
          Petr Škoda added a comment - Thanks for the report and patch! To integrators: please cherry pick to all 2.x branches
          Hide
          Sam Hemelryk added a comment -

          Thanks guys, this has been integrated now

          Sunner thanks for the solution I've cherry-picked your changes to MOODLE_20_STABLE, MOODLE_21_STABLE, and master as they did not merge cleanly with master.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks guys, this has been integrated now Sunner thanks for the solution I've cherry-picked your changes to MOODLE_20_STABLE, MOODLE_21_STABLE, and master as they did not merge cleanly with master. Cheers Sam
          Hide
          Rossiani Wijaya added a comment -

          Test passed.

          Show
          Rossiani Wijaya added a comment - Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          YTC !

          (aka, yay, thanks and ciao ) Closing.

          Show
          Eloy Lafuente (stronk7) added a comment - YTC ! (aka, yay, thanks and ciao ) Closing.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: