Subquery bug #1112854: Subqueries use wrong arguments

Use the instructions at the top of that post to reproduce the same problem.

It is marked as an issue in core but the problem still exists when using a taxonomy filter (with depth), a join and another filter (I think... haven't tested all combinations). As far as I know, only taxonomy with depth uses a subquery so is the only filter affected.

If you turn on devel query logging you can see the query placeholders are incorrect.

A workaround is to reorder the filters, moving the taxonomy filter to the top. Adding the taxonomy subquery to the main query before other filters seems to prevent the issue.

I wanted to order my filters differently because they are exposed and other users shouldn't have to do this workaround manually if at all possible.

Attached is dereine's patch (from the same issue) to clone subquery conditions before adding to the main query. It fixes the issue for me. If the subquery bug isn't going to be fixed until D8 can we test an use this workaround in the meantime?

CommentFileSizeAuthor
views-subquery-bug.patch1010 bytesLiam Mitchell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Adam S’s picture

This problem must be more systemic than just effecting taxonomy with depth. The Content: User posted or commented argument handler also has this problem see Subqueries uses wrong arguments.

Anonymous’s picture

Subscribe

dawehner’s picture

Status: Active » Fixed

Interesting i wrote a patch for this already, didn't know it :)

Thanks for digging it out :)

Commited to 7.x

BenK’s picture

Keeping track of this thread

good_man’s picture

subscribe.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.