File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Drupal/Driver/Fields/Drupal8 Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ public function expand($values) {
15
15
$ entity_type_id = $ this ->fieldInfo ->getSetting ('target_type ' );
16
16
$ entity_definition = \Drupal::entityTypeManager ()->getDefinition ($ entity_type_id );
17
17
18
+ $ id_key = $ entity_definition ->getKey ('id ' );
19
+
18
20
// Determine label field key.
19
21
if ($ entity_type_id !== 'user ' ) {
20
22
$ label_key = $ entity_definition ->getKey ('label ' );
@@ -35,7 +37,11 @@ public function expand($values) {
35
37
}
36
38
37
39
foreach ((array ) $ values as $ value ) {
38
- $ query = \Drupal::entityQuery ($ entity_type_id )->condition ($ label_key , $ value );
40
+ $ query = \Drupal::entityQuery ($ entity_type_id );
41
+ $ or = $ query ->orConditionGroup ();
42
+ $ or ->condition ($ id_key , $ value )
43
+ ->condition ($ label_key , $ value );
44
+ $ query ->condition ($ or );
39
45
$ query ->accessCheck (FALSE );
40
46
if ($ target_bundles && $ target_bundle_key ) {
41
47
$ query ->condition ($ target_bundle_key , $ target_bundles , 'IN ' );
You can’t perform that action at this time.
0 commit comments