Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.7.2
-
MOODLE_27_STABLE
-
MOODLE_27_STABLE
-
47752-28
-
Description
This was first detected when testing MDL-47684 where validation was introduced into moodleform_mod and the value for a modgrade form element was processed by updateValue and came from _submitValues rather than _defaultValues.
The problem comes because:
- In _defaultValues an int is used and is mapped to either a scale (negative value) or point (positive value)
- In _submitValues as the form element was an array of elements the value for a submit form is an array.
I suspect the design of the modgrade component here is intrinsically wrong in that the modgrade element is based on a group and has no actual value.
In the event a form is submitted the updateValue event is called for each individual element in the modgrade group as well as the modgrade (group) element itself.
A bit of debugging shows that the updateValue is called first for the modgrade element, and then for the individual elements that make it up eg:
- scale
- scale[modgrade_type]
- scale[modgrade_scale]
I would suspect that because of this ordering the setting of values logic in modgrade would be undone in the situation of a form submission.
It is also the root of the problem detected in MDL-47684
Attachments
Issue Links
- Discovered while testing
-
MDL-47684 Exception when activity form is not fully completed
-
- Closed
-