Undefined array key "#format" in _webform_entity_element_validate_rendering_error_handler()

Created on 3 April 2024, 3 months ago
Updated 22 April 2024, 2 months ago

Problem/Motivation

PHP warnings show when running drush webform:repair

Warning: Undefined array key "#format" in _webform_entity_element_validate_rendering_error_handler() (line 1138 of .../web/modules/contrib/webform/webform.module)
#0 .../web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 .../web/modules/contrib/webform/webform.module(1138): _drupal_error_handler()
#2 .../web/core/modules/filter/src/Element/TextFormat.php(195): _webform_entity_element_validate_rendering_error_handler()
#3 [internal function]: Drupal\filter\Element\TextFormat::processFormat()
#4 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(1025): call_user_func_array()
#5 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(1088): Drupal\Core\Form\FormBuilder->doBuildForm()
#6 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(1088): Drupal\Core\Form\FormBuilder->doBuildForm()
#7 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(1088): Drupal\Core\Form\FormBuilder->doBuildForm()
#8 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm()
#9 .../web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#10 .../web/modules/contrib/webform/src/WebformEntityElementsValidator.php(572): Drupal\Core\Form\FormBuilder->buildForm()
#11 .../web/modules/contrib/webform/src/WebformEntityElementsValidator.php(219): Drupal\webform\WebformEntityElementsValidator->validateRendering()
#12 .../web/modules/contrib/webform/src/Commands/WebformDevelCommands.php(160): Drupal\webform\WebformEntityElementsValidator->validate()
#13 .../web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\webform\Commands\WebformDevelCommands->Drupal\webform\Commands\{closure}()
#14 .../web/modules/contrib/webform/src/Commands/WebformDevelCommands.php(150): Drupal\Core\Render\Renderer->executeInRenderContext()
#15 [internal function]: Drupal\webform\Commands\WebformDevelCommands->repair()
#16 .../vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#17 .../vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#18 .../vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#19 .../vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#20 .../vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#21 .../vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#22 .../vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#23 .../vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#24 .../vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#25 .../vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#26 .../vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#27 .../vendor/drush/drush/drush(4): require('...')
#28 .../vendor/bin/drush(119): include('...')
#29 {main}

The command still works as it should, though.

Steps to reproduce

Create a webform with an element that doesn't allow plain_text, and make sure that Anonymous doesn't have access to use the format that the element allows.

    message:
      '#type': text_format
      '#title': 'Rich Text Message'
      '#required': true
      '#allowed_formats':
        rich_text: rich_text

drush webform:repair

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

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