For a page display designated "Default menu tab" a parent menu link is not created

Created on 9 August 2024, 4 months ago
Updated 18 September 2024, 3 months ago

Problem/Motivation

The views UI allows for a page display set as the "default menu tab" to specify a "Normal menu link". An alternative option is "Already exists", so this communicates that specifying a "Normal menu link" will create a new menu link, using the provided text for the link, and using the path that is common to the tabs in the group.

The text in the modal labeled "Page: Default tab options" reads:

When providing a menu link as a tab, Drupal needs to know what the parent menu link of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent link will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.

This indicates that if the "Already exists" option is not selected, a menu link will be created. In practice, no parent menu link is created.

Steps to reproduce

On a fresh Drupal install, create a new view with a page display, and set the path to "test/1". Set the menu link to "Default menu tab" with a title of "Test 1". The next screen in the modal will have the title: "Page: Default tab options". Select "Normal menu link" and set the title to "Test".

Create another page display, and set the path to "test/2". Set the menu link to a menu tab, with a menu link title of "Test 2".

Save the view.

Observe that there is no top-level menu item created called "Test". If you manually navigate to [site base url]/test you will see the tabs for "Test 1" and "Test 2" but there is still no top-level menu item created.

Proposed resolution

A menu item should be created appropriate to the settings provided in the view configuration. It's probably worth noting that the "Menu tab" configuration provides an element to specify the the parent, but neither the "Default menu tab" nor the "Parent menu link" modals offer an equivalent selection.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡¨πŸ‡¦Canada mandclu

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024