Same Menu Item in multiple places in the tree

Created on 29 November 2022, over 1 year ago
Updated 27 May 2024, about 1 month ago

Problem/Motivation

Saying you have a menu item in multiple places in the tree, but there is a place where given menu item contains child items the module is always grabbing first element found in the tree.

This is not always true given the following scenario:

Main Menu:

- Item A
-- Item A1
-- Item A2
-- Item B3
- Item B
-- Item B1
-- Item B2
-- Item B3 (Linked to the actual item from branch B3)
--- Item B3.1
--- Item B3.2
--- Item B3.4
- Item C
-- Item C1
-- Item C2
-- Item B3 (Linked to the actual item from branch B3)
- Item D
-- Item D1
--Item D2

So, it will be needed to check if the items returned from the B3 as a contextual filters contains child items to provide the correct menu item with the right parent UUID.

Proposed resolution

If multiple items are returned in getMenuLinkFromTargetUrl method we need to iterate on each of them and check which one contains child items to return the right parent Item.

Remaining tasks

  • βœ… Submit merge request
  • ❌ Write test coverage
  • ❌ Test manually
  • ❌ Commit to the 3.0.x branch
πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡²πŸ‡½Mexico acidaniel

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.69.0 2024