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

Filemanager mform elements are completely discarded in readonly forms

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.6.10, 2.7, 2.7.7, 2.8.5, 2.9
    • Fix Version/s: None
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-45815_master

      Description

      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;

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              daniss Daniele Cordella
              Reporter:
              daniss Daniele Cordella
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Daniele Cordella, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: