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

Filemanager mform elements are completely discarded in readonly forms

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Major Major
    • None
    • 2.6.10, 2.7, 2.7.7, 2.8.5, 2.9
    • Filepicker, Forms Library
    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MDL-45815_master
    • Hide

      Download the attached test_form.php and copy it to the root of your moodle test site.

      • navigate to yourmoodle/test_form.php.
      • drag a file in the filemanager item and submit the form.
      • reload the page. You can see your just uploaded file in the filemanager window. You are in "read/write" mode so you can change or delete it.

      Modify the line 29 of the test_form.php from:
      $editable = true;
      to
      $editable = false;

      • navigate again to yourmoodle/test_form.php.
      • you are in "read only" mode. The just uploaded file is no longer visible. This is the bug.

      Now apply the patch provided here [filemanager_head.patch] to head/lib/form/filemanager.php

      • navigate again to yourmoodle/test_form.php.
      • you are still in "read only" mode but now you can see the uploaded file. You are even allowed to download it BUT YOU CAN NOT CHANGE OR DELETE IT.
      Show
      Download the attached test_form.php and copy it to the root of your moodle test site. navigate to yourmoodle/test_form.php. drag a file in the filemanager item and submit the form. reload the page. You can see your just uploaded file in the filemanager window. You are in "read/write" mode so you can change or delete it. Modify the line 29 of the test_form.php from: $editable = true; to $editable = false; navigate again to yourmoodle/test_form.php. you are in "read only" mode. The just uploaded file is no longer visible. This is the bug. Now apply the patch provided here [filemanager_head.patch] to head/lib/form/filemanager.php navigate again to yourmoodle/test_form.php. you are still in "read only" mode but now you can see the uploaded file. You are even allowed to download it BUT YOU CAN NOT CHANGE OR DELETE IT.

      As a student I submit a record using an mform in the frame of a newmodule. The mform includes some filemanager elements.
      As different student I do not have the capability to edit the already submitted record but I can still browse it.
      So, as module developer, I write the module in order to provide the record to the second student calling the moodleform class in readonly mode
      ...BUT...
      as you can see in the attached php file, THERE IS NO WAY to display the filemanager mform element in readonly mode.

      To get evidence of this, change in the provided php file line 33 from:
      $editable = true;
      to
      $editable = false;

            daniss Daniele Cordella
            daniss Daniele Cordella
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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