Skip to content
Snippets Groups Projects
Commit 43a78711 authored by Rajab Natshah's avatar Rajab Natshah Committed by Mikael Meulle
Browse files

Issue #3485290 by rajab natshah: Fix array_merge for empty bundles in field...

Issue #3485290 by rajab natshah: Fix array_merge for empty bundles in field storage data in Derive for each property
parent 2bf3fd7d
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ abstract class EntityFieldSourceDeriverBase extends DeriverBase implements Conta
$is_base = (in_array($field_name, $entityFieldsClassification["fields_base"]) || ($field_storage_definition instanceof BaseFieldDefinition));
$returned[$field_name] = [
"label" => $field_storage_definition->getLabel(),
"bundles" => array_values($field_info['bundles']),
"bundles" => array_values($field_info['bundles'] ?? []),
"metadata" => [
"configurable" => ($field_storage_definition instanceof FieldStorageConfig),
"editorial" => in_array($field_name, $entityFieldsClassification["fields_editorial"]),
......@@ -437,7 +437,7 @@ abstract class EntityFieldSourceDeriverBase extends DeriverBase implements Conta
$bundle_context_for_properties = (new ContextDefinition('string'))
->setRequired()
->setLabel("Bundle")
->addConstraint('AllowedValues', array_merge($field_storage_data["bundles"], [""]));
->addConstraint('AllowedValues', array_merge($field_storage_data["bundles"] ?? [], [""]));
foreach ($field_storage_data["properties"] as $property_id => $property_data) {
$base_plugin_derivative = array_merge($base_plugin_definition, [
'label' => $property_data["label"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment