Developing a custom theme where some courses are listed on the login page - just the title and a course image (image from get_course_overviewfiles() ).
Also, the expected use case includes the site being set to require login. ( https://docs.moodle.org/34/en/Site_policies#Force_users_to_login )
The problem is: since the visitor is not logged in yet (as we are on the login page), they cannot see the course images.
The image URL is something like /pluginfile.php/113/course/overviewfiles/somecourse201-header.jpg. That URL will load an image if the visitor is logged in, but will not do so if they are not.
If the course allows guest access, we want to allow any visitor to see the course overview files, despite "force users to login" being set.
Trying to figure out the best strategy for getting around this - presumably I need to override some function in the chain that loads the image - but I am getting lost in the weeds. Any thoughts on how to handle this?