PoetOS/moodle-mod_questionnaire

Error when deleting question in survey with dependencies

Closed this issue · 1 comments

When deleting a question in a survey that has dependent questions, the following error message is displayed: count(): Argument #1 ($value) must be of type Countable|array, stdClass given.

This stems from line 190 in questions.php where the argument of count() $haschildren is a class and not an array. Instead of using count(), an alternative would be to use empty for the check in line 190.
Questionnaire_error

I believe this is fixed in the above commit.