Bootstrap 5, figure component: default value for figcaption_attributes

Created on 11 October 2023, about 1 year ago
Updated 12 October 2023, about 1 year ago

Problem/Motivation

Methods are applied without checking if figcaption_attributes exists:

<figcaption{{ figcaption_attributes.addClass('figure-caption') }}>

This is OK for now, because AttributesSettingType::preprocess() is generating empty attributes objects when empty. But this behaviour is a fragile side effect and will disappear with UI Patterns 2.

Proposed resolution

Add a default filter:

<figcaption{{ figcaption_attributes|default(create_attribute()).addClass('figure-caption') }}>

📌 Task
Status

Fixed

Version

5.0

Component

Code

Created by

🇫🇷France pdureau Paris

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024