Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
node-reference-query.patch | 1.47 KB | marcingy | |
Comments
Comment #1
Alex Andrascu CreditAttribution: Alex Andrascu commentedComment #2
Alex Andrascu CreditAttribution: Alex Andrascu commentedComment #3
Alex Andrascu CreditAttribution: Alex Andrascu commentedThank for your patch. It is now commited into 7.x-2.x
Can you please test ?
Thank you.
Comment #4
Alex Andrascu CreditAttribution: Alex Andrascu commented