Problem/Motivation
The module targets older Drupal versions and relies on legacy APIs (annotations, procedural hooks in a .module file, custom accordion JavaScript). It needs to be modernized for Drupal 11.2+ and 12, and a new 2.0.x branch started.
Proposed resolution
- Require Drupal ^11.2 || ^12 and declare the drupal:views dependency.
- Replace the @ViewsStyle annotation with the #[ViewsStyle] attribute.
- Move the preprocess logic to an OOP hook class (src/Hook/SimpleViewsAccordionHooks.php) and remove the .module file.
- Use the native exclusive <details name> accordion instead of custom JavaScript; remove js/ and the simple_views_accordion library.
- Fix accordions on the same page closing each other's items: each rendered accordion now gets a unique name.
- Fix a fatal error when a row has no entity, and stop computing the entity label when the first field is used as the summary.
- Add "Allow multiple items to be open" and "Open the first item by default" style options, with config schema.
- Convert README.txt to README.md with usage and upgrade notes.
- Tests: PHPUnit attributes, replace the deprecated node_add_body_field(), cover exclusive/multiple/open-first behavior and independent accordions.
Remaining tasks
Review and commit; create the 2.0.x branch and release.
Comments
Comment #3
edysmpFixed in release 2.0.1