Moodle
  1. Moodle
  2. MDL-34019

Notice in pluginlib.php (undefined index target)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide

      Check for available updates at both 2.3 and 2.4dev branches. Make sure no PHP notice is thrown.

      Show
      Check for available updates at both 2.3 and 2.4dev branches. Make sure no PHP notice is thrown.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:

      Description

      While updating via the command line, this notice appeared a thousand (ish) times.

      PHP Notice:  Undefined index: target in /home/fred/www/repositories/testing_master/moodle/lib/pluginlib.php on line 814

      This is the context of the line 814

      if (empty($response['forbranch']) or $response['forbranch'] !== moodle_major_version(true)) {
          throw new available_update_checker_exception('err_response_target_version', $response['target']);
      }

      (Happened on stable master and master integration)

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Dan Poltawski added a comment -

            Adding David and Eloy here as this relates tot he available updates ntoifications.

            Show
            Dan Poltawski added a comment - Adding David and Eloy here as this relates tot he available updates ntoifications.
            Hide
            David Mudrak added a comment -

            Submitting for integration. There are two things. Firstly, there was a wrong array key name 'target' left in the code (coming from some original versions of the API). This is fixed in the submitted patch.

            Secondly, we must double-check why this exception has been thrown to people during upgrade. My suspicion is that people upgraded their 'master' branches which now reads '2.4dev' and the updates provider returned them info for 2.3.

            I will double check this yet and will discuss with Eloy. However, the submitted patch should go in in any case.

            Show
            David Mudrak added a comment - Submitting for integration. There are two things. Firstly, there was a wrong array key name 'target' left in the code (coming from some original versions of the API). This is fixed in the submitted patch. Secondly, we must double-check why this exception has been thrown to people during upgrade. My suspicion is that people upgraded their 'master' branches which now reads '2.4dev' and the updates provider returned them info for 2.3. I will double check this yet and will discuss with Eloy. However, the submitted patch should go in in any case.
            Hide
            Michael de Raadt added a comment -

            That second assumption sounds consistent to me.

            Show
            Michael de Raadt added a comment - That second assumption sounds consistent to me.
            Hide
            Andrew Davis added a comment -

            In cron I'm getting the following. It includes the error described in the error report plus something else. Will the something else be fixed by this issue's fix or should I open a separate bug report?

            Notice: Undefined index: target in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 814
             
            Notice: Undefined index: target in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 814
            !!! Coding error detected, it must be fixed by a programmer: PHP catchable fatal error !!!
            !! Argument 1 passed to available_update_checker::compare_responses() must be an array, null given, called in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 1131 and defined
            Error code: codingerror !!
            !! Stack trace: * line 397 of /lib/setuplib.php: coding_exception thrown
            * line 883 of /lib/pluginlib.php: call to default_error_handler()
            * line 1131 of /lib/pluginlib.php: call to available_update_checker->compare_responses()
            * line 760 of /lib/pluginlib.php: call to available_update_checker->cron_execute()
            * line 387 of /lib/cronlib.php: call to available_update_checker->cron()
            * line 88 of /admin/cron.php: call to cron_run()
            

            Show
            Andrew Davis added a comment - In cron I'm getting the following. It includes the error described in the error report plus something else. Will the something else be fixed by this issue's fix or should I open a separate bug report? Notice: Undefined index: target in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 814   Notice: Undefined index: target in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 814 !!! Coding error detected, it must be fixed by a programmer: PHP catchable fatal error !!! !! Argument 1 passed to available_update_checker::compare_responses() must be an array, null given, called in /home/andrew/Desktop/code/moodle/dev/master/lib/pluginlib.php on line 1131 and defined Error code: codingerror !! !! Stack trace: * line 397 of /lib/setuplib.php: coding_exception thrown * line 883 of /lib/pluginlib.php: call to default_error_handler() * line 1131 of /lib/pluginlib.php: call to available_update_checker->compare_responses() * line 760 of /lib/pluginlib.php: call to available_update_checker->cron_execute() * line 387 of /lib/cronlib.php: call to available_update_checker->cron() * line 88 of /admin/cron.php: call to cron_run()
            Hide
            David Mudrak added a comment -

            It's another issue Andrew. Can you report it please, thanks.

            Show
            David Mudrak added a comment - It's another issue Andrew. Can you report it please, thanks.
            Hide
            Andrew Davis added a comment -

            Raised MDL-34140

            Show
            Andrew Davis added a comment - Raised MDL-34140
            Hide
            Dan Poltawski added a comment -

            Thanks David, integrated to 23_STABLE and master (and pinged Andrew about the other issue)

            Show
            Dan Poltawski added a comment - Thanks David, integrated to 23_STABLE and master (and pinged Andrew about the other issue)
            Hide
            Frédéric Massart added a comment -

            Working as described in 2.3 and master. Thanks!

            Show
            Frédéric Massart added a comment - Working as described in 2.3 and master. Thanks!
            Hide
            Sam Hemelryk added a comment -

            Congratulations your code is upstream - gold star for you!

            This issue + 79 others made it in in time for the minor releases.
            Thank you everyone involved for your exuberant efforts.

            Show
            Sam Hemelryk added a comment - Congratulations your code is upstream - gold star for you! This issue + 79 others made it in in time for the minor releases. Thank you everyone involved for your exuberant efforts.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: