Add missing 'label' key to navigation.layouts.yml

Created on 30 May 2024, 6 months ago
Updated 14 June 2024, 5 months ago

Problem/Motivation

The Navigation module adds a layout and registers it using navigation.layouts.yml. According to How to register layouts ,

The 'label' and 'category' keys are required.

but the registered layout does not have a label key.

Steps to reproduce

To see the result of this omission,

  1. Install Drupal with the Umami demo profile.
  2. Enable the field_layout module.
  3. Log in as an administrator.
  4. Visit /en/admin/structure/types/manage/article/form-display.
  5. Expand the "Layout settings" section near the bottom of the page.
  6. Open the "Select a layout" select list.

The select list has a "Navigation layout" category (<optgroup> element), but there are no options under it.

Proposed resolution

In core/modules/navigation/navigation.layouts.yml,

  1. Change the category from "Navigation layout" to "Navigation".
  2. Add the label "Navigation layout".

Compare with core/modules/layout_builder/layout_builder.layouts.yml for a valid layout registration.

After 🐛 Add missing category to Drupal\layout_builder\Plugin\Layout\BlankLayout and let modules and themes alter the list of layouts Fixed , we might decide to remove the Navigation layout from the list of available layouts. Even if we do that, we should still fix this issue since the documentation says that the 'label' key is required.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/A

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
Navigation 

Last updated about 1 hour ago

No maintainer
Created by

🇺🇸United States benjifisher Boston area

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024