Skip to content
Snippets Groups Projects

Issue #3485290: Fix array_merge for empty bundles in field storage data in Derive for each property

Merged Issue #3485290: Fix array_merge for empty bundles in field storage data in Derive for each property
Merged Rajab Natshah requested to merge issue/ui_patterns-3485290:3485290-2-0-x into 2.0.x
@@ -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"],
Loading