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

Deprecate the old events system

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Set debugging level to DEVELOPER

      phpunit and behat should pass

      1. Go to admin/index.php
      2. You SHOULD NOT see a message regarding events 1 api handlers being used
      3. Add $handlers array to a db/events.php as specified in https://docs.moodle.org/dev/Events_API#Handling_an_event with a schedule=instant handler
      4. Bump the version of the plugin you added $handlers and upgrade so the event handlers are registered in db
      5. Perform the required moodle action to trigger that event
      6. Make sure you see a debugging message about switching to events 2 API
      7. Add another event handler with schedule=cron (you might need to purge cache, not sure)
      8. Run cron
      9. Make sure you see a debugging message about switching to events 2 API
      10. Go to admin/index.php
      11. You SHOULD see a message regarding events 1 api handlers being used

      Repeat steps from 1 to 3 with DEBUG_NONE, you should not see any debugging message.

      Remove the $handlers you added

      Show
      Set debugging level to DEVELOPER phpunit and behat should pass Go to admin/index.php You SHOULD NOT see a message regarding events 1 api handlers being used Add $handlers array to a db/events.php as specified in https://docs.moodle.org/dev/Events_API#Handling_an_event with a schedule=instant handler Bump the version of the plugin you added $handlers and upgrade so the event handlers are registered in db Perform the required moodle action to trigger that event Make sure you see a debugging message about switching to events 2 API Add another event handler with schedule=cron (you might need to purge cache, not sure) Run cron Make sure you see a debugging message about switching to events 2 API Go to admin/index.php You SHOULD see a message regarding events 1 api handlers being used Repeat steps from 1 to 3 with DEBUG_NONE, you should not see any debugging message. Remove the $handlers you added
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-48621_master
    • Sprint:
      3.1 Stable Sprint 2, 3.1 Sprint 3

      Description

      While it has been implied that the new events system was replacing the old one, only a debugging message for those using events_trigger directly was showing up.

      At some point we will have to remove:

      • events_trigger()
      • The old events trigger from the new one (cf. get_legacy_eventname, get_legacy_eventdata)
      • events_trigger_legacy()
      • The handler system

      Though before we remove those we must deprecate them, then only 2 releases later we will be able to entirely remove these API.

      IMO the deprecation of these can happen any time from now, the new events were shipped with 2.6.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16