-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
There is error '' not found when trying to create entity with reference on entity which doesn't have defined label key in it's entity type e.g. commerce_license.
To fix this we can try to add condition and modify query:
foreach ((array) $values as $value) {
$query = \Drupal::entityQuery($entity_type_id);
if ($label_key) {
$or = $query->orConditionGroup();
$or->condition($id_key, $value)
->condition($label_key, $value);
$query->condition($or);
}
else {
$query->condition($id_key, $value);
}
$query->accessCheck(FALSE);
if ($target_bundles && $target_bundle_key) {
$query->condition($target_bundle_key, $target_bundles, 'IN');
Metadata
Metadata
Assignees
Labels
No labels