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
Comment #1
amitaibuComment #3
kars-t commentedSorry patch wasn't against HEAD. Added another one.
Comment #4
tstoecklerPatch 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.
Comment #5
amitaibuCommitted, thanks.