Call to a member function first() on null in translatable_menu_link_uri_iterate_menu

Created on 5 February 2025, 2 months ago

Problem/Motivation

After updating from version 2.1.0 to version 2.1.1, our custom module with a custom entity extending the MenuLinkContent class started experiencing issues. The custom entity does not have the link_override field as it is not needed. However, a change introduced on 🐛 Avoid extra DB query per menu item Needs review , removed the validation of the plugin id, now any custom entities with different plugin id, that extends the MenuLinkContent class will have the fatal error happening

Steps to reproduce

  1. Update from version 2.1.0 to version 2.1.1.
  2. Have a custom module with a custom entity extending MenuLinkContent without the link_override field.

Proposed resolution

Introduce a null safe operator to verify if the link_override field exists before attempting to access it.

Remaining tasks

  • Patch/MR.
  • Review.
  • Commit.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇧🇷Brazil murilohp

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