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

edysmp created an issue. See original summary.

  • edysmp committed 785ba61e on 2.0.x
    Issue #3626965 by edysmp: Require Drupal 11.3, add upgrade path for new...
edysmp’s picture

Status: Active » Fixed

Fixed in release 2.0.1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.