Fix fatal error in OgMenuInstanceForm when translation route is null

Created on 5 June 2025, about 1 month ago

Problem/Motivation

When entity translation is enabled and the og_menu module attempts to add a "Translate" operation in OgMenuInstanceForm::buildOverviewTreeForm(), it assumes that the menu link provides a valid translation route using $link->getTranslateRoute().

However, $link is an instance of \Drupal\Core\Menu\MenuLinkInterface, which does not provide a getTranslateRoute() method. This results in a fatal error:

Error: Call to a member function access() on null in Drupal\og_menu\Form\OgMenuInstanceForm->buildOverviewTreeForm()

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇵🇱Poland alorenc Wolsztyn, 🇵🇱

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