martind Posted July 9, 2019 Posted July 9, 2019 hello, i try to use a subfield-selector to find pages with tagged files (downloads) inside a repeater (content_blocks): wire('pages')->find("template=basic-page, content_blocks.downloads.tags!=''"); now, this works as expected when i'm loggedin as superuser, but not as guest. it behaves like no subfield-selector than .count is possible for loggedOut users. any idea what the problem is? ProcessWire 3.0.123 PHP Version 7.0.32 thanks, martin
gmclelland Posted July 9, 2019 Posted July 9, 2019 I believe that is because repeaters store their pages under a different section in the admin tree(Admin>Repeaters>name_of_repeater) which isn't publicly accessible to guests. I think you have to add check_access=0 to your find selector? See https://processwire.com/docs/selectors/#access_control Hope that helps 2
maxf5 Posted July 9, 2019 Posted July 9, 2019 try: wire('pages')->find("template=basic-page, content_blocks.downloads.tags!='', check_access=0"); https://processwire.com/docs/selectors/#access_control
martind Posted July 10, 2019 Author Posted July 10, 2019 thank you both. neither check_access=0 nor include_all=1 works here (even in the field settings, the access-toggle for api usage is set true for both, content_blocks repeater and downloads) . instead i got it working (for both, suberadmin and guest) by doing it like that (similar to Cengiz' solution from the post below): wire('pages')->find("template=basic-page, content_blocks=content_blocks.downloads.tags!='', check_access=0"); maybe this has some impact on further usage of the including function, but for this case it works. Any tips are welcome for a more certain syntax. 1
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