Skip to content

Invisible breadcrumbs at product page when mageMenu widget is not used #14987

@vovayatsyuk

Description

@vovayatsyuk

Preconditions

  1. Magento 2.2.4 only

Steps to reproduce

  1. Open app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml
  2. Remove the following code from the template:
data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'
  1. Navigate to the product page

Expected result

  1. Breadcrumbs should remain visible

Actual result

  1. Breadcrumbs are not rendered

Explanation

2.2.4 release uses js component to render breadcrumbs on the product page.
Here is its init method:

_init: function () {
var menu;
// render breadcrumbs after navigation menu is loaded.
menu = $(this.options.menuContainer).data('mageMenu');
if (typeof menu === 'undefined') {
this._on($(this.options.menuContainer), {
'menucreate': this._super
});
} else {
this._super();
}
},

I don't really know what is this check for if (typeof menu === 'undefined') {, and why do we even need to get mageMenu, maybe @ameysar can help with explanation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions