Skip to content

Commit

Permalink
Issue #3476398: EntityReferenceQueryDeriver::getDerivativeDefinitions…
Browse files Browse the repository at this point in the history
…() may return Undefined array key warning during config import
  • Loading branch information
Luigisa committed Oct 31, 2024
1 parent f5b2062 commit c44734e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ public function getDerivativeDefinitions($basePluginDefinition) {
$targetType = $this->entityTypeManager->getDefinition($targetTypeId);
$fieldName = $fieldDefinition->getName();

$parents = [];
if ($fieldDefinition instanceof BaseFieldDefinition || !$entityType->hasKey('bundle')) {
$parents = [StringHelper::camelCase($entityTypeId)];
}
else {
$parents = [];
elseif (isset($fieldMap[$entityTypeId][$fieldName])) {
foreach ($fieldMap[$entityTypeId][$fieldName]['bundles'] as $bundle) {
$parents[] = StringHelper::camelCase($entityTypeId . '_' . $bundle);
}
}

$derivative = [
'parents' => $parents,
'name' => StringHelper::propCase('query', $fieldName),
Expand Down

0 comments on commit c44734e

Please sign in to comment.