-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.4
Following an upgrade from version 3.9 to 4.1, our users reported that they could no longer access a course 'Settings' page as the following error is displayed:
Exception - Return value of MoodleQuickForm_editor::get_text() must be of the type string, null returned
More information about this error
More information gives the following:
error/moodle/generalexceptionmessage
Jump to:navigation, search
A general error occurred (sorry we can't be more helpful here!)
You could try copying the text that was shown and doing a web search with it.
In Moodle 4.x this error might be caused by trying to use a 'draft' question in a quiz. Check the question bank!
We realised that the get_text(), which was introduced in Moodle 4, was retrieving a NULL for all course areas which were created via the IMS Enterprise plugin and had the Summary set as blank (Leave it empty).
For the courses created via IMS Enterprise, we have now modified the file as follows:
lib/form/editor.php
Function
public function get_text()
/**
* Returns editor text content
*
* @return string Text content
*/
public function get_text(): string {
$text = $this->_values['text'];
if ( $text === NULL )
return $text;
}
For reference, we have Moodle 4.1.4 (Build: 20230612).
This was also reported on the Moodle Community fora:
- has a non-specific relationship to
-
MDL-29421 Form elements editor does not support freezing
-
- Waiting for peer review
-