Errors on Group menus

Created on 1 February 2024, 11 months ago
Updated 30 March 2024, 9 months ago

Problem/Motivation

Love this module, but ran into a problem with Group menus (provided by the Group Content Menu β†’ module). After enabling the recommended release of Domain Menus, the problem started. I get the following fatal errors when attempting to add or edit a group menu link. No problems on regular menus or domain menus.

Error: Call to a member function getThirdPartySetting() on null in domain_menus_menu_link_content_access() (line 362 of modules/contrib/domain_menus/domain_menus.module).

It's possible this is really a Group Content Menu bug, but my debugger led me to a fix that seems to address my problem. So I plan to submit a patch here that seems to be working well for me.

The problem is Menu::load on a group menu id (e.g., group_menu_link_content-2) returns null.

Steps to reproduce

  1. Install Group module
  2. Install Group content menu module
  3. Install Domain module
  4. Install Domain Menus module
  5. Add a group
  6. Add a menu to the group
  7. Try adding links to the menu - error occurs here

Proposed resolution

Just fence off the Menu::load methods so they aren't fired if $menu is null. I realize this probably means my group menus can't take advantage of Domain Menus functionality, but for my current project, that isn't a deal-breaker.

Remaining tasks

Submitting patch momentarily.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States banoodle San Francisco, CA

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

Comments & Activities

Production build 0.71.5 2024