Playa parent search field not working
Hi Low,
I've noticed another issue since updating a site from EE 2.5.5 and Low Search 2.3.1, to EE 2.11.2 and Low Search 4.4.4.
I had an event search form that filters the results to only those events that have a parent Playa entry (an image entry that is linked to the event entry) using the following hidden field in the search form:
<input type="hidden" name="parent:cf_gallery_event[]" value="not IS_EMPTY" />
This used to work fine previously when this field was in the search form, but it's no producing zero results.
Any idea what I should be changing the above code to in the latest version of Low Search?
I did try adding it to the search results tag instead:
search:parent:cf_gallery_event[]="not IS_EMPTY"
But whilst I did then get search results, the filter had no effect on the results.
Thanks for any help,
Stephen
Replies
Low 1 Jul 2016 11:37
The "not IS_EMPTY" syntax would only work with the Field Search filters, not with the Relationships filter. Since you're using Playa (and not the native Relationship field), you could use the Field Search filter here:
Stephen 1 Jul 2016 11:58
Hi Low,
I tried that but it didn't work I'm afraid.
Note that this search is searching the events channel, but the cf_gallery_event is in a separate gallery channel (linked to the events entries via a Playa field). So that's why I was previously using the parent:cf_gallery_event, which did work previously.
Do you have any other ideas?
Thanks,
Stephen
Low 1 Jul 2016 12:12
If parent:cf_gallery_event="not IS_EMPTY" worked, then it worked despite of that syntax. It would have searched for entry IDs that do not match the literal string 'IS_EMPTY'.
Now, it will assume it receives a url title, which it tries to translate to entry IDs. You can look at the template debugger to confirm this. You might be able to overcome this by using parent:cf_gallery_event="not 0" (untested).
Stephen 1 Jul 2016 13:34
Hi Low,
That untested solution worked! :-)
Thanks for this,
Stephen