- Issue created by @halth
- Merge request !3Issue #3524851 by halth: Reversed the parameters of array merge to prioritize data over data → (Open) created by halth
When using schema-based config forms with vertical tabs, the tabs appear empty due to an array merge operation that overwrites field schema mappings with generic type schema information.
When building form elements for a mapping type, the module merges type schema with field schema using:
$mapping_schema = $type_schema + $field_schema;
This causes the generic type schema's empty `mapping` array to overwrite the field schema's `mapping` array that contains the actual tab content, resulting in empty vertical tabs in the form.
1. Create a config schema using mapping types for vertical tabs structure
2. Define content inside the mappings for each tab
3. Create a form extending SchemaBasedConfigForms' ConfigFormBase
4. Access the form
Current behavior:
- Vertical tabs are rendered but appear empty
- The tab content defined in the field schema mappings is lost
Expected behavior:
- Vertical tabs should display their content as defined in the field schema mappings
Invert the array merge operation to preserve field schema mappings:
$mapping_schema = $field_schema + $type_schema;
This ensures that specific field schema definitions take precedence over generic type schema information.
Related code:
// In schema_based_config_forms/src/Form/ConfigFormBase.php, line 185:
$mapping_schema = $type_schema + $field_schema; // Current
$mapping_schema = $field_schema + $type_schema; // Proposed
Active
1.0
Code