Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-78112

Form elements filepicker does not support freezing

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Minor
    • None
    • 3.9.19, 4.1.1
    • Forms Library
    • None
    • MOODLE_39_STABLE, MOODLE_401_STABLE

    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

          Activity

            People

              Unassigned Unassigned
              trishamilan Trisha Milan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.