tiagoroldao Posted July 12, 2012 Posted July 12, 2012 I've been trying to use the PageAutoComplete fieldtype to connect some autors (teachers and students) to a particular work, but allowing to set unpublished (or hidden) student and teacher pages as well. For that, I've established a filter: template=teacher|student, include=all or return $pages->filter("template=teacher|student, include=all") In any other compatible fieldtype, it works just as it should, using php code or just the selector, showing me every teacher/student. But using the PageAutoComplete, it never finds the hidden or unpublished pages. Is it a bug? Or am I doing something wrong?
ryan Posted July 13, 2012 Posted July 13, 2012 PageAutocomplete actually uses the ProcessPageSearch AJAX API which doesn't allow "include=all" except from Superuser. This is for security reasons. Try changing it to "include=hidden" which should at least enable you to show the hidden (though not unpublished) pages.
tiagoroldao Posted July 13, 2012 Author Posted July 13, 2012 Thanks for the reply! Just tested it, using a superuser login as well as a regular editor one, and both don't work, with either include=hidden or include all, for both hidden and unpublished pages..
ryan Posted July 13, 2012 Posted July 13, 2012 Okay I think I tracked down what the issue was. Looks like ProcessPageSearch just didn't support include=hidden directives in the AJAX query. I've updated it so that it does, if you want to try the latest. Let me know if this works from that end too?
tiagoroldao Posted July 13, 2012 Author Posted July 13, 2012 Like a charm, and like you said exactly! Thanks!
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