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

Early call to debugging() in core_component leads to fatal error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: General, Installation
    • Labels:
    • Testing Instructions:
      Hide
      Using a contrib plugin that is missing the new subplugins.json files.
      1. In a just installed site.
      2. Install mod_surveypro:
        1. Download it from https://github.com/kordan/moodle-mod_surveypro/archive/master.zip
        2. Uncompress it to a folder named "surveypro":

          unzip moodle-mod_surveypro-master.zip
          

        3. Rename the uncompressed folder ( moodle-mod_surveypro-master ) to "surveypro".
        4. Move the "surveypro" folder under your "site/mod" folder.
      3. Go to your site main page
      4. Verify that the page loads ok (no blank page or exception info).
      5. Verify that you get in the web server error logs the message "Use of subplugins.php has been deprecated. Please update your 'YOUR/PATH/TO/mod/surveypro' plugin to provide a subplugins.json file instead"
      Show
      Using a contrib plugin that is missing the new subplugins.json files. In a just installed site. Install mod_surveypro : Download it from https://github.com/kordan/moodle-mod_surveypro/archive/master.zip Uncompress it to a folder named "surveypro": unzip moodle-mod_surveypro-master.zip Rename the uncompressed folder ( moodle-mod_surveypro-master ) to "surveypro". Move the "surveypro" folder under your "site/mod" folder. Go to your site main page Verify that the page loads ok (no blank page or exception info). Verify that you get in the web server error logs the message "Use of subplugins.php has been deprecated. Please update your 'YOUR/PATH/TO/mod/surveypro' plugin to provide a subplugins.json file instead"
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This is a regression caused by MDL-65646 when using third part plugins having subplugins with moodle 3.8dev (master) .

      Basically we introduced some debugging() to tell developers that they third-part plugins should stop using subplugins.php and move to subplugins.json.

      But that debugging is happening too early in Moodle's bootstrap/warmup process and debugging() may be not available yet.

      Error follows:

      [21-Jun-2019 08:46:16 UTC] Default exception handler: error/generalexceptionmessage Debug: 
      Error code: generalexceptionmessage
      $a contents: Call to undefined function debugging()
      * line 540 of /lib/classes/component.php: Error thrown
      * line 471 of /lib/classes/component.php: call to core_component::fetch_subtypes()
      * line 383 of /lib/classes/component.php: call to core_component::fetch_plugintypes()
      * line 357 of /lib/classes/component.php: call to core_component::fill_all_caches()
      * line 293 of /lib/classes/component.php: call to core_component::get_cache_content()
      * line 112 of /lib/classes/component.php: call to core_component::init()
      * line ? of unknownfile: call to core_component::classloader()
      * line 593 of /lib/setup.php: call to spl_autoload_call()
      * line 57 of /config.php: call to require_once()
      * line 30 of /index.php: call to require_once()
      

      Note that, to be able to see the error above... we had to hack quite a bit because the exception handler itself was breaking (so early in the process). So MDL-65996 has been created about that.

      Ciao

      PS: Many thanks to Daniele Cordella for raising the issue and helping to trace it down!

      For posterity, the old first section of testing instructions:

      A) Forcing the error within core.
      1. Remove mod/assign/db/subplugins.json
      2. Go to site main page
      3. Verify you get a "debugging" error pointing to

        line 25 of /mod/assign/db/subplugins.php: Error thrown
        line 542 of /lib/classes/component.php: call to include()
        

        That's the importan point (the include one).

      4. Verify that you get in the web server error logs the message "Use of subplugins.php has been deprecated. Please update your 'YOUR/PATH/TO/mod/assign' plugin to provide a subplugins.json file instead"

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 20 minutes
                  2h 20m