ModulesUninstallForm.php assigns string value to ['attributes']['class']

Created on 23 September 2022, over 2 years ago
Updated 7 March 2025, 30 days ago

Problem/Motivation

ModulesUninstallForm.php assigns string value to ['attributes']['class'] which can cause complication since in most cases Array is expected.

In our case, hook_link_alter() was used in custom module to target links with specific class values and additional classes were appended to them. As soon as we upgraded to 9.4, an error was thrown on visiting admin/modules which was complaining about [] operator not supported for strings.

Of course we could change our custom code, but I believe, in principal, ['attributes']['class'] should be an array, since class often holds multiple values.

Proposed resolution

We can simply put the value in [].

Remaining tasks

Write tests

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Form 

Last updated about 10 hours ago

Created by

🇫🇮Finland AlirezaK

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

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