Problem/Motivation

Our custom theme is based on OpenCulturas Base. However, we chose to implement the menu toggle (burger) with different markup, by overriding page.html.twig.

Now we run into this JS error:

Uncaught TypeError: burgerButtonOpen is null
    menuDialogCleanup [host]/profiles/contrib/openculturas-distribution/profile/themes/openculturas_base/js/openculturas-base.js?s7emi6:198

Proposed resolution

The error is caused by the fact that function menuDialogCleanup tries to update elements that might not exist, in our case the open (#button-offcanvas-open) and close (#button-offcanvas-close) buttons.

It should return early when any of the necessary variables does not exist.

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

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Status: Active » Needs review

  • tobiasb committed d0cd420f on 2.0.x authored by mrshowerman
    Issue #3415327 by mrshowerman: JS errors when using a different burger
    

  • tobiasb committed 2b6a2a44 on 2.1.x authored by mrshowerman
    Issue #3415327 by mrshowerman: JS errors when using a different burger
    

tobiasb’s picture

Status: Needs review » Fixed

Thx. Commited and cherry-picked to 2.0.x.

Status: Fixed » Closed (fixed)

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

mrshowerman’s picture