When other modules alter search queries (i.e. i18n to limit nodes language) advanced search is not working. Any search queries that set $this->simple = FALSE in SearchQuery class have this bug.

$this->conditions in class SearchQuery are first compiled in executeFirstPass and then the query conditions change. $this->conditions should be recompiled but it's not.

You can solve this by adding "clone" before passing $this->conditions to $query->condition().

Comments

Status: Needs review » Needs work

The last submitted patch, search.extender.inc_.diff, failed testing.

jhodgdon’s picture

Version: 7.0 » 8.x-dev
Issue tags: -search +Needs backport to D7

Sounds like a real bug. Needs to be investigated/fixed in d8 first, then backported to d7. And if we have a completely redone search module in d8, then this needs to be moved back to d7-dev.

By the way, please don't add random tags to issues. They aren't helpful.

superspring’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

This is the same page as above applied to D8.

jhodgdon’s picture

Issue tags: +Needs tests

I think it would be very helpful to have a test that illustrates this bug that would fail without this patch.

jhodgdon’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)
Related issues: +#1435834: Cannot alter search queries, tag added too late

I think this is actually a duplicate of #1435834: Cannot alter search queries, tag added too late