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

Deprecation of print_error()

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-71062-master
    • Hide

      Prerequisites for testing

      1. Copy the test.php file to the root folder of the moodle project.

      Steps to test

      1. Login as admin
      2. Append '/test.php' to the $CFG->wwwroot (you may get the $CFG->wwwroot from the config.php) and access it from your browser.
        For instance if you access moodle using http://localhost/moodle, then access it by http://localhost/moodle/test.php
      3. You should see error notification and strack trace. In the output buffer you should see message: The function print_error() is deprecated. This has been replaced with throw new moodle_exception()
      Show
      Prerequisites for testing Copy the test.php file to the root folder of the moodle project. Steps to test Login as admin Append '/test.php' to the $CFG->wwwroot (you may get the $CFG->wwwroot from the config.php) and access it from your browser. For instance if you access moodle using http://localhost/moodle, then access it by http://localhost/moodle/test.php You should see error notification and strack trace. In the output buffer you should see message: The function print_error() is deprecated. This has been replaced with throw new moodle_exception()
    • 3
    • QA time 2, 4.1 holding pattern, 4.1 deprecations and cleaning

      In MDL-69936 it was agreed to deprecate print_error() and switch to throw moodle_exception() instead.

      This issue is about to proceed with such deprecation in core. Should cover the following aspects:

      • Decide the target for the deprecation (3.11 or 4.0).
      • Comment about the outcome @ codechecker #137(https://github.com/moodlehq/moodle-local_codechecker/issues/137) , so the deprecation warning can be created then.
      • Apply the standard deprecation policy (debugging, move to deprecatedlib...).
      • Remove all uses from core.
      • Create the phase2 deprecation (final removal) issue, scheduled for the standard 2 years, but with a explicit call about to re-evaluate the situation in plugins when that time arrives. If there are many plugins still using print_error() we may need to delay the removal.
      • Also comment about the outcome @ codechecker #137(https://github.com/moodlehq/moodle-local_codechecker/issues/137) once the final removal happens (so the function is moved from the Deprecation Sniff to the Forbidden one).

      Ciao

        1. MDL-71062.png
          58 kB
          John Edward Pedregosa
        2. remaining_print_error_uses.txt
          107 kB
          Jonathan Champ
        3. test.php
          0.1 kB
          Sujith Haridasan

            sujith Sujith Haridasan
            stronk7 Eloy Lafuente (stronk7)
            Mathew May Mathew May
            Jun Pataleta Jun Pataleta
            John Edward Pedregosa John Edward Pedregosa
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 6 hours, 10 minutes
                1d 6h 10m

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