Jump to content


Photo

PageAutoComplete fieldtype and hidden pages bug

Module

  • Please log in to reply
4 replies to this topic

#1 tiagoroldao

tiagoroldao

    Jr. Member

  • Members
  • PipPip
  • 19 posts
  • 5

  • LocationPortugal

Posted 12 July 2012 - 11:25 AM

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?

#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,771 posts
  • 3107

  • LocationAtlanta, GA

Posted 13 July 2012 - 10:14 AM

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.

#3 tiagoroldao

tiagoroldao

    Jr. Member

  • Members
  • PipPip
  • 19 posts
  • 5

  • LocationPortugal

Posted 13 July 2012 - 11:07 AM

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..

#4 ryan

ryan

    Hero Member

  • Administrators
  • 5,771 posts
  • 3107

  • LocationAtlanta, GA

Posted 13 July 2012 - 01:03 PM

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?

#5 tiagoroldao

tiagoroldao

    Jr. Member

  • Members
  • PipPip
  • 19 posts
  • 5

  • LocationPortugal

Posted 13 July 2012 - 03:59 PM

Like a charm, and like you said exactly! Thanks!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users