Notice: Undefined index: #summary_attributes in template_preprocess_details() (line 244 of core/includes/form.inc).

Created on 24 September 2018, about 6 years ago
Updated 11 August 2023, over 1 year ago

Drupal 8.6.x introduced the #summary_attributes property to details elements, and template_preprocess_details expects the property to exist in the render array (template_preprocess_details). BEF checkboxes are rendered in a details element and because #summary_attributes is not set the following warnings are given:

Notice: Undefined index: #summary_attributes in template_preprocess_details() (line 244 of core/includes/form.inc).
Warning: Invalid argument supplied for foreach() in Drupal\Core\Template\Attribute->__construct() (line 81 of core/lib/Drupal/Core/Template/Attribute.php).

It can be fixed by assigning an empty array to $form[$field_id]['#summary_attributes'] in exposedFormAlter()

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇪🇸Spain Peacog

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024