You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the changes of the behaviour of the count function in PHP 8 seem to cause issues in the questionnaire_check_page_breaks() function in some cases.
I get the following error in my case thenever editing any existing instance of mod_questionnaire with PHP8:
Got error 'PHP message: PHP Warning: Undefined array key 73 in MYPATH/mod/questionnaire/locallib.php on line 756
PHP message: PHP Warning: Trying to access array offset on value of type null in MYPATH/mod/questionnaire/locallib.php on line 758
PHP message: PHP Warning: Trying to access array offset on value of type null in MYPATH/mod/questionnaire/locallib.php on line 785
PHP message: PHP Warning: Undefined array key 72 in MYPATH/mod/questionnaire/locallib.php on line 788
PHP message: PHP Warning: Trying to access array offset on value of type null in MYPATH/mod/questionnaire/locallib.php on line 788
PHP message: PHP Warning: Undefined array key 72 in MYPATH/mod/questionnaire/locallib.php on line 789
PHP message: PHP Warning: Trying to access array offset on value of type null in MYPATH/mod/questionnaire/locallib.php on line 789
PHP message: PHP Warning: Trying to access array offset on value of type null in MYPATH/mod/questionnaire/locallib.php on line 791
PHP message: Default exception handler: Fehler: count(): Argument #1 ($value) must be of type Countable|array, null given Debug: \nError code: generalexceptionmessage\n* line 791 of /mod/questionnaire/locallib.php: TypeError thrown\n* line 288 of /mod/questionnaire/questions.php: call to questionnaire_check_page_breaks()\n', referer: https://MYMOODLE/mod/questionnaire/questions.php
This seems to resolve the issue but is not a very pretty solution to the problem and I am not sure if it acually fixes the underlying problem or just works around it.
Edit: I have just noticed that the function code has changed in the MOODLE_400_STABLE branch. Maybe the changes just need to be applied to the MOODLE_311_STABLE branch to resolve the issue?
The text was updated successfully, but these errors were encountered:
This should work in the MOODLE_400_STABLE branch.
I have cherry-picked the fixes from there into a 3.11 branch (Pull request #484). If you can test that, we can merge it in.
Hi all,
the changes of the behaviour of the count function in PHP 8 seem to cause issues in the questionnaire_check_page_breaks() function in some cases.
I get the following error in my case thenever editing any existing instance of mod_questionnaire with PHP8:
The code in question can be found here:
moodle-mod_questionnaire/locallib.php
Lines 784 to 807 in 47d48c9
For testing I changed it so it emulates the old behaviour of the count() function:
This seems to resolve the issue but is not a very pretty solution to the problem and I am not sure if it acually fixes the underlying problem or just works around it.
Edit: I have just noticed that the function code has changed in the MOODLE_400_STABLE branch. Maybe the changes just need to be applied to the MOODLE_311_STABLE branch to resolve the issue?
The text was updated successfully, but these errors were encountered: