Problem/Motivation

A warning is logged when adding/editing a "hidden" webform element.

Warning: Undefined array key "admin_title" in webform_validation_webform_element_configuration_form_alter() (line 59 of /var/www/html/web/modules/contrib/webform_validation/webform_validation.module)

Steps to reproduce

The relevant code is:

  $this_element_title = $customProperties['admin_title'] ?: $customProperties['title'];

However, $customProperties does not have an admin_title key for a hidden element.

Proposed resolution

  $this_element_title = !empty($customProperties['admin_title']) ? $customProperties['admin_title'] : $customProperties['title'];

Or, if admin_title should be used if it exists, even if it's an empty string:

  $this_element_title = $customProperties['admin_title'] ?? $customProperties['title'];

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

solideogloria created an issue. See original summary.

geoffreyr made their first commit to this issue’s fork.

solideogloria’s picture

Status: Active » Needs review

Liam Morland made their first commit to this issue’s fork.

liam morland’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rudi teschner’s picture

Adding an advanced html/text element according to https://www.drupal.org/project/webform_validation/issues/3261965 there still is an error:

Warning: Undefined array key "title" in webform_validation_webform_element_configuration_form_alter() (Zeile 59 in /var/www/html/docroot/modules/contrib/webform_validation/webform_validation.module).

liam morland’s picture

Please open a new issue about this.