Incompatibility with Domain Menu Access

Created on 20 January 2025, 3 months ago
Updated 2 February 2025, 2 months ago

Problem/Motivation

In it is current state, the TB Mega Menu module to not work along with Domain Menu Access.

Steps to reproduce

These steps assumes you have domain_access installed on your site with configured domains.

- Install both tb_megamenu and domain_menu_access.
- Create a menu and enable domain_menu_access for it.
- Add items to this menu with domain menu access configuration.
- Configure TB mega menu with this menu
- Use the TB mega menu block to display the menu

The domain menu access configuration for these menu items won't be considered, and all links will be displayed ignoring the current domain.

Proposed resolution

Use the checkDomain() method defined by domain_menu_access by adding it to the manipulator list in template_preprocess_tb_megamenu():

$moduleHandler = \Drupal::service('module_handler');
if ($moduleHandler->moduleExists('domain_menu_access')) {
  $manipulators[] = [
    'callable' => 'domain_menu_access.default_tree_manipulators:checkDomain'
  ];
}

A similar implementation can be found in the DomainMenuAccessMenuMenuBlock class.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France yvalentin

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

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