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

Deprecate the old events system

    XMLWordPrintable

Details

    • MOODLE_29_STABLE
    • MOODLE_31_STABLE
    • MDL-48621_master
    • 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
    • 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

              dmonllao David Monllaó
              fred Frédéric Massart
              Dan Poltawski Dan Poltawski
              Andrew Lyons Andrew Lyons
              Adrian Greeve Adrian Greeve
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23/May/16