-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
3.9.19, 4.1.1
-
None
-
MOODLE_39_STABLE, MOODLE_401_STABLE
HTML_QuickForm_element has a nice feature called freezing. One can call $element->freeze() and element will be displayed as a static label+value pair plus a hidden field with a value.
There is also an attribute _persistantFreeze (see method setPersistantFreeze), true by default. If set to false, no hidden field is generated.
This feature is forgotten in the elements of type 'editor' and 'filepicker' (lib/form/editor.php and lib/form/filepicker.php)
method toHtml() in both classes call getFrozenHtml() if element is frozen, but the classes do not redeclare the function getFrozenHtml()
in case of filepicker, the draftitemid is displayed (could be list of files)
in case of editor, warning is thrown because parent function assumes value to be a scalar. Also editor needs to redeclare hidden field generation in _getPersistantData() (or not use this function)
the select field (lib/pear/HTML/QuickForm/select.php) can be used as an example of an element with an array stored in _value.
- duplicates
-
MDL-29421 Form elements editor does not support freezing
-
- Development in progress
-