Moodle
  1. Moodle
  2. MDL-31796

$mform->disabledIf doesn't work for 'filemanager' mform elements

    Details

    • Testing Instructions:
      Hide

      create a form
      add one 'filemanager' element
      add one 'hidden' element
      preset the hidden element to 0 and to 1. Look at the status of the 'filemanager' element.

      Show
      create a form add one 'filemanager' element add one 'hidden' element preset the hidden element to 0 and to 1. Look at the status of the 'filemanager' element.
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      38414

      Description

      The following code does not work as expected.

      $fieldname = 'filemanagername';
      $attachmentoptions = array('maxbytes' => 1024, 'accepted_types' => '*', 'subdirs' => false, 'maxfiles' => -1);
      $mform->addElement('filemanager', $fieldname, 'filemanager_label', null, $attachmentoptions);
      $mform->disabledIf($fieldname, 'referencefield', 'eq', '1');
      

      so, the 'filemanager' mform element is not disable even if 'referencefield' is equal to 1

        Activity

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: