Views Bootstrap Accordions no longer working after Drupal 10.4 update if core JavaScript aggregation is active

Created on 19 December 2024, 7 days ago

Problem/Motivation

I'll be honest, I don't think for a moment that the root cause of this is actually the View Bootstrap module but I have raised here initially to get some feedback from other user of the module as I suspect other may fall foul of it too.

Basically, my Views Bootstrap Accordions have been working well for ages but after a Drupal 10.3 >> Drupal 10.4 (which I note does some JS / JQuery related updates which is beyond the comprehension of my tiny brain), my view based on Views Bootstrap Accordion view broke in that clicking on any of the titles no longer opens the Accordion.

Switch OFF core JavaScript aggregation and they all spring back into life.

I have checked the JS console and while there are some other whinges going on, nothing gets added or taken away when I turn core Aggregation OFF and back ON so I don't really know quite where else to look right now.

Just thought I'd throw it out there.

Thanks

πŸ› Bug report
Status

Active

Version

5.5

Component

Accordion

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SirClickALot
  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset
  • πŸ‡ΊπŸ‡ΈUnited States kwiseman

    I just tried setting up a Views Bootstrap accordion with a Drupal 10.4 site and have also noticed that the accordion buttons don't open their content. However, I have aggregation turned off. In my view, I've set accordion grouping to "Accordion content by grouped field" (in other words, group the output).

    For accordions with grouped output only, I noticed that invalid HTML ids were being generated for the accordion's header and the <div> holding the accordion's body (lines 30 and 35 of views-bootstrap-accordion.html.twig). The invalid part of their IDs comes from a xss-filtered version of the accordion button's text set as an array key in the preprocess function for the accordion template (line 55 of views_bootstrap.theme.inc, I think). When I cleaned the filtered button text to make sure it works as an HTML id, the accordions began to work for me.

    @sirclickalot, are your accordions grouped too? Maintainers, does what I'm experiencing sound like a separate issue? If so, I'll be happy to make that issue, elaborate, and/or provide the MR.

Production build 0.71.5 2024