Symfony Mailer Lite: Error: Cannot use object of type Attribute as array

Created on 17 January 2024, 11 months ago
Updated 24 August 2024, 4 months ago

Problem/Motivation

I'm trying to use the Drupal Symfony Mailer Lite β†’ module, but attempting to render e-mails triggers an error in Bootstrap Barrio's preprocess code.

Steps to reproduce

Enable Symfony Mailer Lite module, attempt to send a test message.

Error generated is:

Error: Cannot use object of type Attribute as array in bootstrap_barrio_preprocess() (line 790 of /var/www/web/themes/contrib/bootstrap_barrio/bootstrap_barrio.theme).

which occurs while trying to render the `symfony_mailer_lite_email` theme hook.

(In `template_preprocess_symfony_mailer_lite_email()` the "attributes" key is initialized as an object.)

Proposed resolution

Check whether attributes is an array before looking for the "classes" key.

(This was apparently introduced by #3291257: Textarea's form errors are hidden (again) β†’ which now applies its logic to every theme hook in the system...)

πŸ› Bug report
Status

Fixed

Version

5.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom grahamC Oxford, UK

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