-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
3.1.3, 3.1.4, 3.1.5, 3.2, 3.2.1, 3.2.2
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MDL-58519_master
The MoodleQuickForm_editor::getValue() returns an array of null values if the editor field is disabled or even not present in the form for any reason.
This makes MoodleQuickForm::exportValues() to fail and think something is submitted.
More explanation:
The MoodleQuickForm::exportValues method has the following bit:
$value = $this->_elements[$key]->exportValue($this->_submitValues, true);
|
//...
|
if (is_array($value)) {
|
// This shit throws a bogus warning in PHP 4.3.x
|
$unfiltered = HTML_QuickForm::arrayMerge($unfiltered, $value);
|
}
|
So it checks if the exportValue returns an array and if it does, considers the returned value as either the user's submitted data or the default value of the field.
All fields return null if they don't have any value except editor fields. They return an array of null. In particular, they return
array('text'=>null, 'format'=>null, 'itemid'=>null)
|