Problem/Motivation

In the menu-region--footer.html.twig file the menu_heading_id variable is used to set the id attribute value for the h4 tag. However the variable assignment is missing in the code thus resulting in id attribute with no value.

Id attribute for h4 element is missing a value.

Steps to reproduce

1. Install Navigation module.
2. Inspect the templates HTML output and see that id has no value.

Also {{ dump(menu_heading_id }} returns null.

Proposed resolution

Add {% set menu_heading_id = 'menu--' ~ menu_name|clean_unique_id %} to templates/menu-region--footer.html.twig to assign value to menu_heading_id.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
Screenshot 2024-04-27 at 16.36.34.png27.63 KBjulilan

Issue fork drupal-3443899

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

julilan created an issue. See original summary.

julilan’s picture

Issue summary: View changes
julilan’s picture

Assigned: Unassigned » julilan
julilan’s picture

Issue summary: View changes

julilan’s picture

Assigned: julilan » Unassigned
Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Checking navigation-menu.html.twig this appears to be the same solution, so believe it is good.

Thanks!

  • nod_ committed 07597fe6 on 11.x
    Issue #3443899 by julilan, smustgrave: menu_heading_id variable is not...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Awesome, thanks a lot for the clear issue summary and the MR!

  • catch committed ec035f4b on 10.3.x authored by nod_
    Issue #3443899 by julilan, smustgrave: menu_heading_id variable is not...
catch’s picture

Status: Patch (to be ported) » Fixed

  • nod_ committed 07597fe6 on 11.0.x
    Issue #3443899 by julilan, smustgrave: menu_heading_id variable is not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.