Problem/Motivation

In version 5.1.5 a line of code 397 was changed from $variables['content']['#attributes']['block'] = $variables['attributes']['block']; to $variables['content']['#attributes']['id'] = $variables['attributes']['id'];

due to this change the code in function bootstrap_barrio_theme_suggestions_menu_alter() does not work and further menu suggestions based on block presentation is not available any more.

Steps to reproduce

Add main menu to any two regions in block placements, both have menu--menu.html.twig suggestion, so it limits developer to theme same menu differently if displayed twice on page in different regions.

Proposed resolution

after line of code 397, add following code $variables['content']['#attributes']['block'] = $variables['attributes']['block'];

This will fix the issue and the menu suggestions will be extended to menus placed as blocks in different regions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Qandeel created an issue. See original summary.

Qandeel’s picture

Here is the patch

Qandeel’s picture

Issue summary: View changes
FileSize
679 bytes

Here is an updated patch

hatuhay’s picture

Status: Active » Fixed

  • Qandeel authored 5b4a65c on 5.5.x
    Issue #3238496 by Qandeel: Code in Suggestion Menu Alter does not work...
hatuhay’s picture

Status: Fixed » Active

Fixed on 5.5.x reopened fot 5.1.5

  • Qandeel authored 0d46a48 on 5.x
    Issue #3238496 by Qandeel: Code in Suggestion Menu Alter does not work...
hatuhay’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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