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

File preview broken when browsing some Workshop file areas

    XMLWordPrintable

Details

    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-55957-master-workshopfiles
    • Hide
      1. Repeat the steps to reproduce and make sure that embedded images can be picked by browsing the server files.
      2. You may wish to go an extra mile and test the images behaviour under various conditions - such as images embedded in unpatched Moodle or restored from an older backup.
      Show
      Repeat the steps to reproduce and make sure that embedded images can be picked by browsing the server files. You may wish to go an extra mile and test the images behaviour under various conditions - such as images embedded in unpatched Moodle or restored from an older backup.

    Description

      When browsing for files via the Server files repository in the Workshop instructauthors, instructreviewers and conclusion file areas, the image previews are broken.

      Steps to reproduce

      1. Create a new Workshop instance. Upload an image into the "Instructions for submission" or "Instructions for assessment" or "Conclusion" field.
      2. Save the form.
      3. Edit the workshop again.
      4. Into some other field (such as into the Description), attempt to embed the previously embedded image via using the Server files repository.

      Expected behaviour: You should be able to browse to the relevant file area and see the image preview.

      Actual behaviour: The file preview is broken (see screenshot).

      Reason

      The reason for this is that in workshop_get_file_info() we declare the itemid should not be used (see the sixth argument of the returned file_info_stored object's constructor at the end of the function). This leads to URL where the itemid is not present at all. But then in workshop_pluginfile() we expect the itemid is always passed (even if we ignore it).

      Attachments

        Activity

          People

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            Frédéric Massart Frédéric Massart
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Raquel Ortega, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Nov/16

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h