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

Filemanager cannot be disabled by disabledif when in a form group

XMLWordPrintable

    • 1
    • Team Hedgehog 2024 Sprint 2.1, Team Hedgehog 2024 Sprint 2.2
    • Small

      In the attached php file (with a mform class definition method), I added a "radio" and a "filemanager" mform element.

      "Filemenager" SHOULD get disabled on the basis of the selection of the radio button.
      If the first "radio" is selected, the filemanager is active. Otherwise, it is not.

      In spite of this, it seems the disabilitation does not ALWAYS work. Infact, for instance, it does not work if the filemanager element is added to the mform using $mform->addGroup.

      You can try it by yourself coping the attached file to your local moodle root and navigating it.

      It seems the line:
      $mform->disabledIf($filemanagerbasename, $booleanbasename, 'neq', '1');
      in line 61 has no effect.

      On the opposite side: by setting

      $usefilemanagergroup = false

      in line 47, the same "filemanager" element is added to the form using the simpler $mform->addElement and the disabilitation works fine.

            david.woloszyn@moodle.com David Woloszyn
            daniss Daniele Cordella
            Meirza Meirza
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 37 minutes
                3h 37m

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