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

Log is missing in the logs report when someone use a direct link to a ressource

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.6
    • Fix Version/s: None
    • Component/s: Resource
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      To reproduce the problem

      1. Create a resource with an image
      2. Click on the resource image
      3. Right click on the image and do 'view image'
      4. Copy the url of the displayed image
        it give something like :|https://mymoodle.xyz/pluginfile.php/2000000/mod_resource/content/1/123456.jpg

      When you use directly this url you're not in the logs report. It also work with documents.

      to solve the problem I've add these two lines
      $resource = $DB->get_record('resource', array('id' => $cm->instance), '*', MUST_EXIST);
      resource_view($resource, $course, $cm, $context);
      Line 417 of the file /mod/resource/lib.php in Moodle 3.7.1+

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            palumbo Dominique
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: