Hi

in 7.x-2.2 you og uses in line 525

if (entityreference_get_selection_handler($field, $instance)->getReferencableEntities()) {

in the latest dev it was changed to

if (entityreference_get_selection_handler($field, $instance)->getReferencableEntities(NULL, 'CONTAINS', 1)) {

This is much better as only one entity is loaded and not all.

But there is a better way without loading any entity

if (entityreference_get_selection_handler($field, $instance)->countReferencableEntities()) {

Does the same query and does not load any entity. Patch is attached.

Comments

amitaibu’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, og_nodeaccess_count.patch, failed testing.

kars-t’s picture

Status: Needs work » Needs review
StatusFileSize
new569 bytes

Sorry patch wasn't against HEAD. Added another one.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks great. I must admit that I did not try this out, but in this case I don't know if that's actually necessary, because the fix is quite obvious. So tentatively setting to RTBC. Hope that's OK.

amitaibu’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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