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

Improve deprecation messages

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.8
    • Events API
    • MOODLE_28_STABLE

      Below are some deprecation messages I am receiving from a local plugin.

      events_trigger() is deprecated, please use new events instead
      line 283 of /lib/deprecatedlib.php: call to debugging()
      line 1409 of /local/hub/lib.php: call to events_trigger()
      line 138 of /local/hub/admin/register.php: call to local_hub->create_hub_token()

      add_to_log() has been deprecated, please rewrite your code to the new events API
      line 48 of /lib/deprecatedlib.php: call to debugging()
      line 1411 of /local/hub/lib.php: call to add_to_log()
      line 138 of /local/hub/admin/register.php: call to local_hub->create_hub_token()

      Receiving the deprecation messages is correct but they are not particularly helpful.

      "please use new events instead" Where would I find out about these new events? A link to a guide specifically about switching would be ideal but failing that, how about a link to a description of these new events?

      Googling "events_trigger() is deprecated, please use new events instead" and "add_to_log() has been deprecated, please rewrite your code to the new events API" comes up with nothing particularly helpful. We should have a page in docs that contains the error message so that people googling will get something useful.

      As an added bonus how about explicitly stating in what version the function was deprecated and in what version it is expected to be removed. That will tell people how urgently they need to remove calls to deprecated code.

            Unassigned Unassigned
            andyjdavis Andrew Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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