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

Missing edit button at folder ressource if dispayed inline on the course page.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2, 3.2.1, 3.2.2, 3.3.3, 3.5.3, 3.6
    • Fix Version/s: None
    • Component/s: Resource
    • Labels:
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      If a student or teacher have got the permission to edit the content of a folder ressource (mod/folder:managefiles), the edit button does not appear in the view if the folder content is dispayed inline on the course page.

      Presumed reproduction steps

      • as teacher or manager, go to a course
        • turn editing on
      • insert a folder ressource to the course, set "Display folder contents" to "Inline on a course page"
      • enrol a student to the course
      • for that folder, click edit → assign roles
      • click role teacher and add the previously added student to this teacher role
      • log out and log in as student
      • scroll to the folder ressource and your cannot see a edit button even if you have the permission to edit (mod/folder:managefiles)

       

      As I figured out the problem is the check on (moodle/course:manageactivities) for inline folder ressources.

      So if you have the capability (moodle/course:manageactivities and mod/folder:managefiles) 

      of a single inline folder ressourse activity you have no way to edit the content.

       

      One Solution might be to remove the line of these checks on Line 84 in mod/folder/renderer.php:

       
              // Display the "Edit" button if current user can edit folder contents.
              // Do not display it on the course page for the teachers because there
              // is an "Edit settings" button right next to it with the same functionality.
              if (has_capability('mod/folder:managefiles', $context) &&
                  ($folder>display != FOLDER_DISPLAY_INLINE || !has_capability('moodle/course:manageactivities', $context)))- {
                  $editbutton = $this->output->single_button(
                      new moodle_url('/mod/folder/edit.php', array('id' => $cm->id)),
                      get_string('edit')
                  );

                  $buttons .= $editbutton;
              }
       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: