-
Bug
-
Resolution: Fixed
-
Minor
-
3.7.2
-
MOODLE_37_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-67084-master -
There is a function _prepareValue() that must be used in form elements exportValue() and it is not always used.
For example,
$mform->addElement('text', 'eltext[0]', 'extext');
|
$mform->addElement('duration', 'elduration[0]', 'elduration');
|
Will result in the $data object:
stdClass Object
|
(
|
[eltext] => Array
|
(
|
[0] =>
|
)
|
|
[elduration[0]] => 0
|
[submitbutton] => Save changes
|
)
|
See the attached testform.php
We want to use "duration" element inside repeated elements and it gives inconsistent result to the other elements.
There is also 'modgrade' element that does not call _prepareValue() however it can only be used inside the activity module edit form and it's too complicated to try to fix