Now that the entity reference fields added by Entityqueue are not locked and are configurable, there's a lot of potential for confusion around the bundle filtering, because you can specify the bundle filtering both in the queue settings and in the field settings.

This can cause problems because if any filtering is specified in either place, the *combination* of the two settings get added to the entity field query.

To avoid this problem, we should not allow bundles to be selected on the field settings form if the "Entity Selection" mode is set to Entityqueue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch created an issue. See original summary.

quicksketch’s picture

FileSize
3.03 KB

Patch that hides the settings and replaces it with a description of where the bundles may be set.

quicksketch’s picture

FileSize
4.47 KB

Slightly further reworked patch that also warns you shouldn't use the Entity Queue selection mode on any entity type other than an Entity Queue.

  • quicksketch committed bde1c3f on 7.x-1.x
    Issue #2929030 by quicksketch: Make clear that using the "Entityqueue"...
quicksketch’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x.

Status: Fixed » Closed (fixed)

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

amateescu’s picture

+++ b/plugins/entityreference/selection/EntityReference_SelectionHandler_EntityQueue.class.php
@@ -38,12 +38,47 @@ class EntityReference_SelectionHandler_EntityQueue extends EntityReference_Selec
-    $handler = EntityReference_SelectionHandler_Generic::getInstance($this->field, $this->instance, $this->entity_type, $this->entity);
-    $query = $handler->buildEntityFieldQuery($match, $match_operator);
+    $query = parent::buildEntityFieldQuery($match, $match_operator);

Noting here for posterity: this patch broke the entityqueue selection handler because it doesn't take all the core overrides for buildEntityFieldQuery() into account anymore. Fixed in #2949180: The entityqueue selection handler doesn't take all the core overrides into account.