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

Notice in pluginlib.php (undefined index target)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

          Attachments

            Issue Links

              Activity

              Hide
              poltawski Dan Poltawski added a comment -

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

              Show
              poltawski Dan Poltawski added a comment - Adding David and Eloy here as this relates tot he available updates ntoifications.
              Hide
              mudrd8mz David Mudrák 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
              mudrd8mz David Mudrák 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
              salvetore Michael de Raadt added a comment -

              That second assumption sounds consistent to me.

              Show
              salvetore Michael de Raadt added a comment - That second assumption sounds consistent to me.
              Hide
              andyjdavis 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
              andyjdavis 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
              mudrd8mz David Mudrák added a comment -

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

              Show
              mudrd8mz David Mudrák added a comment - It's another issue Andrew. Can you report it please, thanks.
              Hide
              andyjdavis Andrew Davis added a comment -

              Raised MDL-34140

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

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

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

              Working as described in 2.3 and master. Thanks!

              Show
              fred Frédéric Massart added a comment - Working as described in 2.3 and master. Thanks!
              Hide
              samhemelryk 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
              samhemelryk 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:
                    Fix Release Date:
                    9/Jul/12