- Issue created by @tomthorp
I noticed my Drupal 11 site not working as it should using the Zircon 10.1.x-dev theme. Whenever it was in mobile mode with the hamburger icon showing, clicking on it was non-functioning. Further investigation yielded the following error :
bootstrap.js?v=8.0.0:622 Uncaught TypeError: Cannot convert object to primitive value
at HTMLDivElement.<anonymous> (bootstrap.js?v=8.0.0:622:45)
at T.each (jquery.min.js?v=4.0.0-beta.2:2:2876)
at T.fn.init.each (jquery.min.js?v=4.0.0-beta.2:2:1386)
at T.fn.init.Plugin [as collapse] (bootstrap.js?v=8.0.0:617:17)
at HTMLButtonElement.<anonymous> (bootstrap.js?v=8.0.0:663:12)
at HTMLDocument.dispatch (jquery.min.js?v=4.0.0-beta.2:2:38062)
at v.handle (jquery.min.js?v=4.0.0-beta.2:2:36042)
The current Bootstrap version (v3.2.0) used in Zircon 10.1.x-dev is incompatible with Drupal Core's jQuery (v4.0). To resolve this, two library entries were made into zircon.libraries.yml .
zircon.bootstrap:
version: "3.2.0"
js:
assets/includes/bootstrap/js/bootstrap.js: {}
dependencies:
- zircon/jquery-1.11.1
jquery-1.11.1:
js:
'//code.jquery.com/jquery-1.11.1.min.js': { type: external, minified: true }
Also, an entry was made into zircon.info under the libraries section :
libraries:
- zircon/global-styling
- zircon/zircon.bootstrap
Flush the cache using 'drush cr' once the changes have been made and test functionality.
Unless I am missing something, there is an incompatibility issue with bootstrap v3.2.0 with Drupal 11 Core's jQuery v4.0, that needs to be resolved by the theme developers.