My current work setup:
Moodle 5.2+ (Build: 20260525)
PHP 8.3.31
MariaDB 11.4.10
Record RTC v2.0 question type - I know it is only listed for Moodle 5.0 - I am testing anyway, though.
I had been doing some development work with questions in the up coming Content Pages v3.0.0 plugin release, and for a couple of different types of question plugins I have been running into a Whoops problem when I try to create a question.
When I change the suggested line of code the problem does seem to go away.
I would like to know if anyone else sees or can reproduce the problem when trying to create a Record RTC question in Moodle v5.2+.
Copilot Pro+ tells me the problem is in Moodle core code:
Root cause: core bug in question/classes/local/bank/view.php line 1296
<?php
foreach ($this->extrarows as $row) {
if (str_contains($attributes['class'], 'highlight')) {
$rowclasses .= ' extrarow' . ' ' . $this->extrarows[0]; // ← bug
}
$row->display($question, $rowclasses);
}
$this->extrarows is an associative array keyed by column name (e.g. 'question_text_row'). The code at line 1296 tries to read it with integer key 0, which never exists. PHP 8+ makes that a hard warning that Whoops converts to an exception.
Trigger conditions (both must be true simultaneously):
extrarowsis non-empty — i.e. at least one "extra row" column (like the question text preview row) is visible in the question bank.- A question row has the
highlightclass — this happens automatically when$question->id == $this->lastchangedid, i.e. you just created that question and the bank refreshes to show it.
Creating a new RecordRTC question satisfies condition 2 immediately, which is why you see it on first creation of that type.
Nothing in iContent caused or triggered this. The question bank used is standard core Moodle.