PHP error on passing array in attributes variable with add_attributes()

Created on 9 August 2022, almost 2 years ago
Updated 16 May 2024, about 1 month ago

Problem/Motivation

Got following error
Error: Call to a member function removeAttribute() on array in Drupal\emulsify_twig\AddAttributesTwigExtension->add_attributes() (line 89 of modules/contrib/emulsify_twig/src/AddAttributesTwigExtension.php).

Steps to reproduce

I am getting above PHP error, if default attributes variable is array and for additional_attribute we call add_attributes() function.

Proposed resolution

Update code $context['attributes']->removeAttribute($key); to unset($context['attributes'][$key]);

Remaining tasks

User interface changes

NA

API changes

NA

Data model changes

NA

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇮🇳India Bunty Badgujar Delhi

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