No support for disabled menus

Created on 21 July 2023, over 1 year ago
Updated 22 August 2024, 3 months ago

Even though you can disable individual menu items and whole hierarchies through the "Enabled toggle", JSON:API Menu Items will only show enabled menu items in the JSON:API. That means that the enabled field in the JSON:API output will always be set to true.

The reason for this behaviour is the following line https://git.drupalcode.org/project/jsonapi_menu_items/-/blob/1.2.x/src/R... which ensures that only enabled menu items will be shown.

But there is value in letting the frontend choose how to handle enabled and disabled menus. At least I'd hope to have this configurable.

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇮🇹Italy dgsiegel

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

Comments & Activities

  • Issue created by @dgsiegel
  • 🇺🇸United States Topplestack Rural, Idaho

    Second this. We have a situation where the menu only appears if a page is in the menu, but want the link to several pages to not appear in the menu so that the user arrives at the page via a separate navigation method.

  • 🇺🇸United States mglaman WI, USA

    Are there concerns disabled items being exposed could be considered a security issue around information disclosure?

    Menus are config entities; maybe we can add a third_party_settings, which adds a checkbox that says "Provide disabled menu links over the API" as an opt-in for this. How does that sound?

Production build 0.71.5 2024