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

Plugin's lib.php loaded prematurely during plugins installation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.3.2
    • None
    • MOODLE_33_STABLE
    • Hide

      Fix test

      1. Follow the steps to reproduce and assert seeing the expected behaviour (hint: this was discovered while attempting to install local_yumymedia without local_yukaltura)

      Regression test

      1. Repeat the test from MDL-53978
      Show
      Fix test Follow the steps to reproduce and assert seeing the expected behaviour (hint: this was discovered while attempting to install local_yumymedia without local_yukaltura) Regression test Repeat the test from MDL-53978

      I have a suspicion that MDL-53978 caused a regression. Those calls like

      get_plugins_with_function('before_http_headers', 'lib.php');
      

      are also made during plugin installation (when rendering the plugin checks screen) and they cause lib.php files be loaded from all plugins - even if the plugin may have an unsatisfied dependency.

      Reproduce:
      1. Have a plugin B that correctly declares dependency on a plugin A. In the B's lib.php, require_once() some A's file.
      2. Unzip the code of the plugin B into Moodle and run installation by visiting the admin main screen

      Expected:
      The missing dependency A should be reported, giving the admin the opportunity to provide it

      Actual:
      PHP fatal error thrown because B's lib.php has been loaded prematurely to check for the presence of the new callbacks.

            Unassigned Unassigned
            mudrd8mz David Mudrák (@mudrd8mz)
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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