removeAttribute() method not found on array

Created on 27 January 2022, over 2 years ago
Updated 16 May 2024, about 1 month ago

Problem/Motivation

After updating my D8 site to D9.3.3, I'm having an issue with the BemTwigExtension.

Error: Call to a member function removeAttribute() on array in Drupal\emulsify_twig\BemTwigExtension->bem() (line 109 of /app/web/modules/contrib/emulsify_twig/src/BemTwigExtension.php)

Steps to reproduce

Update to Drupal 9.3.3. and load a themed page. Ends up with a 502 Bad Gateway page.

Proposed resolution

I wrapped line 109 with:

 if(is_object($context['attributes'])){
   $context['attributes']->removeAttribute($key);
 }

This has it working for me for now, but I'm not sure what it's affecting elsewhere that I've not found yet.

Remaining tasks

Should this work with arrays as well as objects? Does it need to?

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dchaffin

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.69.0 2024