Fix: Warning: foreach() argument must be of type array|object, null given in menu_link_attributes_menu_link_content_form_entity_builder()

Created on 3 November 2023, about 1 year ago

Problem/Motivation

There is an issue Warning: foreach() argument must be of type array|object, null given in menu_link_attributes_menu_link_content_form_entity_builder() (line 147 of modules/contrib/menu_link_attributes/menu_link_attributes.module). when adding a new menu item without providing any attribute value

Steps to reproduce

1. Create a new menu item for any menu and do not provide any attribute value for the item
2. Click the save button
3. There will be shown a warning message: Warning: foreach() argument must be of type array|object, null given in menu_link_attributes_menu_link_content_form_entity_builder() (line 147 of modules/contrib/menu_link_attributes/menu_link_attributes.module).

Proposed resolution

1. Prepare a proper patch in order to fix the issue
2. Prepare an MR for review

Remaining tasks

Write the fix and do the mentioned above.

User interface changes

No.

API changes

No.

Data model changes

No.

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

🇲🇩Moldova andrei.vesterli Chisinau

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

Comments & Activities

Production build 0.71.5 2024