BillH Posted September 21, 2023 Share Posted September 21, 2023 I have an area in the front end of a site that can be accessed only by logged-in users with a particular role. The page works fine for such users, except that images in a repeater field don't appear. Each image field within the repeater displays either the alt text or a placeholder (depending on which browser), but the image does not load. Attempting to load one of the images on its own in a window using its URL also fails. However, the images load correctly when the page is accessed by a superuser. It thus seems as if users with the role don't have permission to access the images. I've tried specifically giving view access on the field settings, but it doesn't help. I can't think what other settings might work. Does anyone know what I should be doing? Link to comment Share on other sites More sharing options...
poljpocket Posted September 21, 2023 Share Posted September 21, 2023 Have you compared the URL of the images in the superuser / non-superuser cases? Link to comment Share on other sites More sharing options...
BillH Posted September 21, 2023 Author Share Posted September 21, 2023 Thanks @poljpocket, a useful thought and I've just checked. In each case the URLs are identical. Link to comment Share on other sites More sharing options...
poljpocket Posted September 21, 2023 Share Posted September 21, 2023 Okay, please check the setting of the page's template you can find under "Access", then "Prevent direct access to file assets owned by pages using this template?". Did you configure something there? 1 Link to comment Share on other sites More sharing options...
BillH Posted September 21, 2023 Author Share Posted September 21, 2023 "Prevent direct access to file assets owned by pages using this template?" is set to "No". I tested the other two settings, and they didn't change anything. Also, following on from your suggestion, I checked $config->pagefileSecure in wire/config.php, and it's set to "false". Link to comment Share on other sites More sharing options...
BillH Posted September 21, 2023 Author Share Posted September 21, 2023 However, I've just found that $page->secureFiles() returns "true". [EDIT] I don't understand this, but I'm not sure how relevant it is, as I think I may have found the solution - see next post. Link to comment Share on other sites More sharing options...
BillH Posted September 21, 2023 Author Share Posted September 21, 2023 I think the solution may be here (applied to a repeater rather than a repeater matrix), though I'm still conducting tests: Link to comment Share on other sites More sharing options...
poljpocket Posted September 21, 2023 Share Posted September 21, 2023 Well.. that might be something, yes! In the end, Repeater Matrix is just an extended form of a Repeater (RepeaterMatrix literally extends Repeater in PHP) and thus might inherit such behaviours too. 1 Link to comment Share on other sites More sharing options...
BillH Posted October 9, 2023 Author Share Posted October 9, 2023 I've finally got back to dealing with this... And the link in my previous post does provide a working solution. Thanks @poljpocketfor your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now