Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.1.1, 3.6.5, 3.7.1, 3.8
-
Fix Version/s: DEV backlog
-
Component/s: Forms Library
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_21_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
Epic Link:
-
Pull from Repository:
-
Pull Master Branch:MDL-29421-master
-
Pull Master Diff URL:
Description
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.
Attachments
Issue Links
- has been marked as being related by
-
MDL-56105 mform->disabledIf not working properly for filepicker
-
- Open
-
-
MDL-29701 mform disableif doesn't work on 'editor' element when wysiwig enabled
-
- Closed
-
-
MDL-57195 Check Boost theme handling of the soft and hard frozen form elements
-
- Open
-
-
MDL-30974 forms API, phpdocs and devdocs
-
- Closed
-
- is duplicated by
-
MDL-45815 Filemanager mform elements are completely discarded in readonly forms
-
- Open
-
-
MDL-58739 Custom profile fields - text area content not shown when disabled.
-
- Closed
-
-
MDL-25067 mform editor element can not be disabled with mform->disabledIf method
-
- Closed
-
- will be (partly) resolved by
-
MDL-45815 Filemanager mform elements are completely discarded in readonly forms
-
- Open
-
-
MDL-58519 MoodleQuickForm_editor::getValue() is not compatible with MoodleQuickForm::exportValues() logic
-
- Closed
-