Jump to content

Pagefield Autocomplete allowing selection of current page


thetuningspoon
 Share

Recommended Posts

I am having a problem where I need to prevent a Page field that is using autocomplete from allowing me to select the page I am currently editing. I thought that was supposed to be the default behavior, but it is allowing me to select the current page anyway. Since the custom PHP code option doesn't work with autocomplete, I'm a bit at a loss for what to do.

Link to comment
Share on other sites

  • 2 weeks later...

Clarification... the page didn't allow me to save the self-referential value, but it did appear in the ajax search and allow me to select it from the list. This is a big problem for a site I'm working on at the moment.

To solve this I had to edit InputfieldPageAutocomplete.module and add the following to getAjaxUrl() after the first line of the function:

// Prevent selecting the page this field is on
$thisPageId = $this->input->get->id;
$selector .= ",id!=$thisPageId";

It seems like this is a bug.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...