In node_reference_field_prepare_view all the nodes in status 0 for a given user are added to the db_select query even though we are only interested in the ids we need to check as a result we often don't need to be build an OR query. Patch attached to build the OR clause more intelligently. At the moment this uses an IN query, an alternative approach would be to keep the current query and do an array_intersect and then conditionally build the OR condition. If that route is preferred I'll happily create an alternative patch.

CommentFileSizeAuthor
node-reference-query.patch1.47 KBmarcingy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alex Andrascu’s picture

Status: Active » Needs review
Alex Andrascu’s picture

Assigned: Unassigned » Alex Andrascu
Alex Andrascu’s picture

Thank for your patch. It is now commited into 7.x-2.x
Can you please test ?

Thank you.

Alex Andrascu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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