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

One more array_key_exists() on objects

XMLWordPrintable

      This case escaped MDL-66968 because the structure should be clearly an array. And was hidden behind other ongoing php74 fixes still not integrated.

      You can see the problem happening here: https://ci.moodle.org/view/Testing/job/DEV.74%20-%20PHPUnit%207.4%20-%20MDL-66260/5/ (search for array_key_exists in the console -> view as text output.

      There you will find 8 failures caused by grade/grading/form/rubric/lib.php:389.

      After becoming a little bit crazy, it was discovered that the problem is the json_decode() call some lines above that returns the associative array as an object.

      So, the fix is, simply, about to add the 2nd parameter to that call in order to get the information returned as array, making php74 array_key_exists happy.

      Here there is another run of the same job above, with the patch applied: https://ci.moodle.org/view/Testing/job/DEV.74%20-%20PHPUnit%207.4%20-%20MDL-66260/6/

      You can see that there are 8 less failures and that, in the console -> view as text output there isn't any remaining array_key_exists occurrence.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Mathew May Mathew May
            Jake Dallimore Jake Dallimore
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m

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