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

Empty subplugins.json can cause errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.8, 4.1.3
    • 4.0.7
    • General
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77783-401
    • MDL-77783-master
    • Hide
      1. Log in as an admin
      2. Remove the "plugintypes" data of mod/assign/db/subplugins.json
      3. Bump version.php
      4. Open a terminal and tail the apache error log. e.g.

        tail -f /path/to/apache2/error.log
        

      5. Trigger the upgrade process on the site (eg. by going to the admin page). But don't go through the upgrade process yet.
      6. Confirm that you get don't get any warnings on the upgrade page.
      7. Watch the error log.
      8. Confirm that you get an error log that indicates that "plugintypes" is not defined in the assign's subplugins.json file.
      9. Remove all the contents of the assign's subplugins.json file
      10. Reload the page.
      11. Confirm that you get don't get any warnings on the upgrade page.
      12. Check the error log.
      13. Confirm that you get an error log that indicates that the assign's subplugins.json is invalid.
      14. Go through the upgrade process
      15. Confirm that upgrade works without any PHP errors/warnings.
      Show
      Log in as an admin Remove the "plugintypes" data of mod/assign/db/subplugins.json Bump version.php Open a terminal and tail the apache error log. e.g. tail -f /path/to/apache2/error.log Trigger the upgrade process on the site (eg. by going to the admin page). But don't go through the upgrade process yet. Confirm that you get don't get any warnings on the upgrade page. Watch the error log. Confirm that you get an error log that indicates that " plugintypes " is not defined in the assign's subplugins.json file. Remove all the contents of the assign's subplugins.json file Reload the page. Confirm that you get don't get any warnings on the upgrade page. Check the error log. Confirm that you get an error log that indicates that the assign's subplugins.json is invalid. Go through the upgrade process Confirm that upgrade works without any PHP errors/warnings.

      Plugins may define a subplugins.json file that is not valid and cause errors on the site.

      To reproduce:

      1. Log in as an admin
      2. Remove the contents of mod/assign/db/subplugins.json
      3. Bump version.php
      4. Go to any page that can trigger the upgrade process. e.g. [MOODLE_URL]/admin/index.php#linkmodules

      You'll get the following notices:

      Warning: Attempt to read property "plugintypes" on null in /Users/jun/Work/moodles/stable_master/moodle/lib/classes/component.php on line 577
      

        1. MDL-77783.png
          1.08 MB
          Ron Carl Alfon Yu

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Huong Nguyen Huong Nguyen
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 3 hours, 30 minutes
                1w 3h 30m

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