Not working with Settings Type url and token

Created on 24 April 2021, over 3 years ago
Updated 12 December 2023, about 1 year ago

Problem/Motivation

When using component blocks with Token and URL Ui Patterns Setting I got following error

The configuration property third_party_settings.layout_builder.sections.0.components.b536dbe7....configuration.settings.url.input doesn't exist.

The problem is that both settings return an array instead of a string.

I switched the setting type in the schema to the sequence. Not sure if this is the right way.

Steps to reproduce

Add an pattern with UI Patterns Settings with setting type URL or token. Fill the setting.

Proposed resolution

Change the schema type.

🐛 Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

🇩🇪Germany Christian.wiedemann

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France just_like_good_vibes PARIS

    Hello,
    experiencing the same issue here.

    the problem, seems to be a bit deeper from my understanding.
    Indeed, let's take the example of a settings of type "token".
    i configure a block in layout builder, which is mapped to a pattern, and i have ui_pattern_settings module enabled.
    my pattern has a settings of type token -> "close_title".
    i can configure my block in layout builder without error, including the settings close_title.

    but when i save the layout, i have an error :

    The configuration property third_party_settings.layout_builder.sections.0.components.3967b6f6-0208-4868-ba2f-8a3a6fefb983.configuration.settings.close_title.input doesn't exist." at /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php line 77

    the "input" is added inside \Drupal\ui_patterns_settings\Plugin\TokenSettingTypeBase::settingsForm.

    this function is called inside \Drupal\component_blocks\Plugin\Block\ComponentBlock::formatterSettingsProcessCallback

    from my understanding, the component_block module, retrieves some form elements for the settings,
    and in case of tokens, an. additional form key "input" is added, which further creates a configuration with that "input" as a parent key for the value, when it shouldn't.

    something would need to be changed inside \Drupal\component_blocks\Plugin\Block\ComponentBlock::blockSubmit ?

Production build 0.71.5 2024