-
Bug
-
Resolution: Fixed
-
Minor
-
2.9.8, 3.0.6, 3.1.2
-
MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MDL-55957-master-workshopfiles -
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
- Create a new Workshop instance. Upload an image into the "Instructions for submission" or "Instructions for assessment" or "Conclusion" field.
- Save the form.
- Edit the workshop again.
- 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).