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

Properly deprecate notify()

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1
    • 2.9
    • Libraries
    • MOODLE_29_STABLE
    • MOODLE_31_STABLE
    • MDL-50269_master
    • Easy
    • Hide
      Test 1
      1. Review the patch and confirm it makes sense.
      Test 2
      1. Check there are no calls to the function notify() in core.
      Test 3
      1. Download the attached file notify_test.php and place it in your root directory. Visit <yoursite>/notify_test.php and confirm you get the below output -

      The course is empty
      WARNING: Cannot copy the file
      ERROR: The Common Cartridge import requires PHP 5 or higher.
      ERROR: The Common Cartridge import requires DOM extension.
      ERROR: The Common Cartridge import requires LIBXML extension.
      ERROR: The Common Cartridge import requires LIBXML version 2.6.30 or newer.
      ERROR: The Common Cartridge import requires XSL.
      ERROR: The Common Cartridge package requires authorization.
      The schema is not valid.
      Cannot load the XML manifest.
      Question sessions for questions 1, 2, 3 were missing when upgrading question usage.
      notify() is deprecated, please use $OUTPUT->notification() instead
       
          line 915 of /lib/deprecatedlib.php: call to debugging()
          line 64 of /notify_test.php: call to notify()
       
      Should get a debugging message.
      

      Show
      Test 1 Review the patch and confirm it makes sense. Test 2 Check there are no calls to the function notify() in core. Test 3 Download the attached file notify_test.php and place it in your root directory. Visit <yoursite>/notify_test.php and confirm you get the below output - The course is empty WARNING: Cannot copy the file ERROR: The Common Cartridge import requires PHP 5 or higher. ERROR: The Common Cartridge import requires DOM extension. ERROR: The Common Cartridge import requires LIBXML extension. ERROR: The Common Cartridge import requires LIBXML version 2.6.30 or newer. ERROR: The Common Cartridge import requires XSL. ERROR: The Common Cartridge package requires authorization. The schema is not valid. Cannot load the XML manifest. Question sessions for questions 1, 2, 3 were missing when upgrading question usage. notify() is deprecated, please use $OUTPUT->notification() instead   line 915 of /lib/deprecatedlib.php: call to debugging() line 64 of /notify_test.php: call to notify()   Should get a debugging message.

      Properly deprecate notify()

      notify()

      backup/cc/cc2moodle.php:            notify('The course is empty');
       
      backup/cc/entities.class.php:                    notify('WARNING: Cannot copy the file ' . $source . ' to ' . $destination);
       
      backup/cc/restore_cc.php:                notify(get_string('cc_import_req_php5', 'imscc'));
       
      backup/cc/restore_cc.php:                notify(get_string('cc_import_req_dom', 'imscc'));
       
      backup/cc/restore_cc.php:                notify(get_string('cc_import_req_libxml', 'imscc'));
       
      backup/cc/restore_cc.php:                notify(get_string('cc_import_req_libxmlminversion', 'imscc'));
       
      backup/cc/restore_cc.php:                notify(get_string('cc_import_req_xsl', 'imscc'));
       
      backup/cc/restore_cc.php:                        notify(get_string('cc2moodle_req_auth', 'imscc'));
       
      backup/cc/restore_cc.php:                    notify(get_string('cc2moodle_invalid_schema', 'imscc'));
       
      backup/cc/restore_cc.php:                notify(get_string('cc2moodle_manifest_dont_load', 'imscc'));
       
      question/engine/upgrade/upgradelib.php:            notify("Question sessions for questions " .
      

            markn Mark Nelson
            ankit_frenz Ankit Agarwal
            Mark Nelson Mark Nelson
            David Monllaó David Monllaó
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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