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.
Issue fork openculturas-3415327
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:
- 3415327-js-errors-when
changes, plain diff MR !1
Comments
Comment #3
mrshowermanComment #7
tobiasbThx. Commited and cherry-picked to 2.0.x.
Comment #9
mrshowerman