- Issue created by @gugalamaciek
- 🇪🇸Spain luigisa Olloki Valley
Thank you very much for the patch. It has been applied.
Automatically closed - issue fixed for 2 weeks with no activity.
We have error like Undefined array key "field_dummy_name" EntityReferenceQueryDeriver.php:100. when we try to import configuration containing:
Error occurs, because EntityReferenceQueryDeriver::getDerivativeDefinitions()
is called on new external entity type save (by ExternalEntityType::postSave()
).
Try to import configuration having:
paragraphs.paragraphs_type.dummy_paragraph_type
field_dummy_name
external_entities.external_entity_type.dummy_external_entity_type
So... in our case, what happened during import:
paragraphs.paragraphs_type.dummy_paragraph_type.yml
importedfield.storage.paragraph.field_dummy_field_name.yml
importedexternal_entities.external_entity_type.dummy_external_entity_type
import error occured, because it was imported earlier than field.field.paragraph.dummy_paragraph_type.field_dummy_name.yml
What we can do, we can modify EntityReferenceQueryDeriver::getDerivativeDefinitions()
from:
if ($fieldDefinition instanceof BaseFieldDefinition || !$entityType->hasKey('bundle')) {
$parents = [StringHelper::camelCase($entityTypeId)];
}
else {
$parents = [];
foreach ($fieldMap[$entityTypeId][$fieldName]['bundles'] as $bundle) {
$parents[] = StringHelper::camelCase($entityTypeId . '_' . $bundle);
}
}
to:
$parents = [];
if ($fieldDefinition instanceof BaseFieldDefinition || !$entityType->hasKey('bundle')) {
$parents = [StringHelper::camelCase($entityTypeId)];
}
elseif (isset($fieldMap[$entityTypeId][$fieldName])) {
foreach ($fieldMap[$entityTypeId][$fieldName]['bundles'] as $bundle) {
$parents[] = StringHelper::camelCase($entityTypeId . '_' . $bundle);
}
}
Active
3.0
Code
Thank you very much for the patch. It has been applied.
Automatically closed - issue fixed for 2 weeks with no activity.