Element without explicit #access => TRUE is removed by \Drupal\webform\Plugin\WebformElementBase::setConfigurationFormDefaultValueRecursive()

Created on 29 April 2024, about 2 months ago

Problem/Motivation

I have tried to add the following warning to a custom Webform element in \Drupal\foo\Plugin\WebformElement\FooSelect::form() like the code example below and I was surprised when I saw that it has not been rendered. After some debugging it turned out that the logic at the end of \Drupal\webform\Plugin\WebformElementBase::setConfigurationFormDefaultValueRecursive() removes elements without explicit '#access' => TRUE,.


    $form['warning'] = [
      '#theme' => 'status_messages',
      '#message_list' => [
        'warning' => [
          $this->t('Fooo'),
        ],
      ],
//      '#access' => TRUE,
    ];

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

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

Comments & Activities

Production build 0.69.0 2024