Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / entityqueue / src / Plugin / views / relationship / EntityQueueRelationship.php
index 6145c9478ab3b08dbc0a5084c341e20cea0eaa47..9b8e86d2d5f6d87764fad04034639e9ea0266746 100644 (file)
@@ -109,8 +109,6 @@ class EntityQueueRelationship extends EntityReverse implements CacheableDependen
    * {@inheritdoc}
    */
   public function query() {
-    parent::query();
-
     // Add a 'where' condition if needed.
     if (!empty($this->definition['extra'])) {
       $bundles = [];
@@ -121,12 +119,16 @@ class EntityQueueRelationship extends EntityReverse implements CacheableDependen
           $bundles[] = $extra['value'];
         }
       }
-      $this->definition['join_extra'][] = [
-        'field' => 'bundle',
-        'operator' => 'IN',
-        'value' => [$bundles],
-      ];
+      if (count($bundles) > 0) {
+        $this->definition['join_extra'][] = [
+          'field' => 'bundle',
+          'value' => $bundles,
+        ];
+      }
     }
+
+    // Now - let's build the query.
+    parent::query();
   }
 
 }