[2.0.0-alpha3] Form builder: Simpler & nestable sources selector (3/3)

Created on 3 June 2024, 6 months ago
Updated 3 July 2024, 5 months ago

Following 📌 [2.0.0-alpha3] Form builder: Simpler sources selector (2/2) + make it nestable Needs work , some remaining work to do.

Nesting

Works well with 2 levels nesting.

I have this issue with 3 levels nesting:

Warning: Undefined array key "settings" in Drupal\ui_patterns_field_formatters\Plugin\UiPatterns\Source\FieldFormatterSourceBase->viewFieldItems() (line 80 of modules/custom/ui_patterns/modules/ui_patterns_field_formatters/src/Plugin/UiPatterns/Source/FieldFormatterSourceBase.php)
TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in array_intersect_key() (line 155 of core/lib/Drupal/Core/Field/FormatterPluginManager.php)

My config:

id: node.article.default
targetEntityType: node
bundle: article
mode: default
content:
  body:
    type: ui_patterns_all
    label: hidden
    settings:
      ui_patterns:
        component_id: 'ui_suite_bootstrap:card'
        variant_id: default
        props:
          image_position:
            source_id: select
            source:
              value: top
          image_col_classes:
            source_id: textfield
            source:
              value: col-md-4
          content_col_classes:
            source_id: textfield
            source:
              value: col-md-8
        slots:
          content:
            sources:
              -
                source:
                  type: ui_patterns_all
                  settings:
                    ui_patterns:
                      component_id: 'ui_suite_bootstrap:button'
                      variant_id: default
                      slots:
                        label:
                          sources:
                            -
                              source:
                                type: text_default
                              source_id: 'field_properties_source_slot:node:body'
                              _weight: '0'
                      props:
                        disabled:
                          source_id: checkbox
                        label_visually_hidden:
                          source_id: checkbox
                        url:
                          source_id: url
                          source:
                            value: ''
                source_id: 'field_properties_source_slot:node:body'
                _weight: '0'

Simpler implementation

  • Remove UiPatternsOperations form element
  • Remove buildPluginConfiguration() from SourcePluginManager
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024