The incorrect config schema for the title extra setting.

Created on 22 March 2024, 3 months ago
Updated 8 April 2024, 3 months ago

Problem/Motivation

There is the following schema:

viewsreference.enabled_settings.title:
  type: boolean
  label: 'Include View Title settings'

After saving the field and export configs there is the following value:
.....

    options:
      title: true

.....

In the ViewsReferenceTrait exists a code that uses settings to build the "options" form element:

    $enabled_settings = array_filter($this->getFieldSetting('enabled_settings') ?? []);
    foreach ($enabled_settings as $key => $enabled_setting) {
      if (!empty($plugin_definitions[$enabled_setting])) {
        $plugin_definition = $plugin_definitions[$enabled_setting];
.....
    } 

In this case $enabled_setting = TRUE, but for getting the plugin_definition needs to be the string value of plugin id, 'title'.

Steps to reproduce

1. Add the viewsreference field type.
2. Enable the Include View Title setting

3. Save field.
4. Export configuration.

Proposed resolution

Change the config scheme to:

viewsreference.enabled_settings.title:
  type: string
  label: 'Include View Title settings'
πŸ› Bug report
Status

Closed: duplicate

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine v.dovhaliuk

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024