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

Wiki on front page does not show images to guests

XMLWordPrintable

    • MOODLE_404_STABLE

      We have a wiki on the front page. Only some members have the permission to edit the wiki pages but everybody, even non-logged-in guests, should be able to view the wiki pages. This works well for text-only pages but images are not shown. They are replaced by a white rectangle and if the image URL is opened directly (e.g. https://example.com/pluginfile.php/155/mod_wiki/attachments/6/image.jpg ) the user will be redirected to the login form.

      I could track the problem down to the call of `require_login` in `wiki_pluginfile` in `mod/wiki/lib.php`.

      If this line is removed, the image is shown. I think the line can be removed completeley, the files are already protected by `require_capability('mod/wiki:viewpage', $context);` some lines further down.

      Henrik

        1. image-2024-05-16-11-08-08-543.png
          24 kB
          Laurent David
        2. Screenshot_20240516_112126.png
          405 kB
          Henrik Gebauer
        3. Screenshot_20240516_112246.png
          69 kB
          Henrik Gebauer
        4. Screenshot_20240516_112334.png
          100 kB
          Henrik Gebauer

            Unassigned Unassigned
            henrik.gebauer Henrik Gebauer
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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