Affects Version/s: 3.7.6
Fix Version/s: None
To reproduce the problem
- Create a resource with an image
- Click on the resource image
- Right click on the image and do 'view image'
- 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+