jQuery UI is deprecated and core has moved away from in it Drupal 9. This module uses jQuery UI Accordion to make the accordion field group formatter work and to prevent breaking sites that use the accordion formatter, #3109552: Prepare Field Group for Drupal 9 was implemented which adds a dependency on the new jQuery UI Accordion contrib module (since it's no longer provided by core).

A better long term solution is to remove the dependency all together. I guess that means either replacing it with another JS open source library, implementing our own solution, or using the "Details" element only and removing the "Accordion" item as an option. At least marking it as legacy/deprecated.

Comments

bkosborne created an issue. See original summary.

shreyal999’s picture

Status: Active » Needs review

Created patch to update the dependency

shreyal999’s picture

StatusFileSize
new370 bytes
klemendev’s picture

Status page warning should be removed in this case too, this patch does not cover this.

karlshea’s picture

jwilson3’s picture

Regarding #4, yes! This warning message is very annoying and it bothers non-technical website stakeholders who are not Drupal experts to see a "warning" when there is no practical way to fix it. We even considered enabling the jquery ui accordion module as a way to make the error go away, before diving into the code to figure out what this was all about.

Essentially we searched our config YAML files for instances of field_group, and instances of format_type, looking for "accordion" and found no mention of that. Enabling the module should really only be needed by websites that are actually using the accordion.

I see several ways to resolve this:

  1. Change the severity from warning to info, that way the message will be in status report for those that need it, but it doesn't constantly annoy those who don't. (this was proposed by @alexp999 in comment #8 on #3212987-8: Remove warning for accordion in status report)
  2. Only warn if a field group is actually using a the accordion format type. Improve the warning so it points to exactly where its being used. this could be done by some kind of on-the-fly inspection for field_group fields defined in the website that are using format_type: accordion.
  3. Move the accordion type to a submodule that depends on the jquery_ui_accordion module to avoid the warning completely unless you install the sub-module. This is a bit heavy handed, especially if there is going to be some replacement accordion functionality coming in core in the future. (See #3056089: Provide a new render element for accordion)
  4. Add option to "confirm or dismiss this warning" (this was suggested by @Webbeh in #3233539: Configuration option to disable Status Report's "jQuery UI Accordion not enabled"). This seems like programming overkill. Why create another variable to track the dismissal of the warning, when we could simply use the same time to write a patch that does #1 and/or #2 or #3 are imho smarter alternatives — in the sense of attacking the actual problem space not treating the symptom.

I favor option #1 the best, because it is the least amount of code changes and testing required, and would satisfy the behavior for the majority of folks here who are not using the accordion anywhere. However, the most correct solution would be to combine both #1 and #2 together... i.e. make it an INFO by default, and change it to a WARNING if fields are found that utilize the accordion type.

For bonus points and even more correctness the module should be showing this warning on the Manage Fields screen as soon as someone tries to select the accordion type for a field group without the module being enabled.

jwilson3’s picture

StatusFileSize
new1.01 KB
new673 bytes

This patch handles comment #4 and #6.1

jwilson3’s picture

Title: Remove dependency on jQuery UI Accordion for the accordion field group formatter » Remove jQuery UI Accordion dependency and warning
damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Drupal 9 compatibility

While these could be split up, it's a valid fix for D9 compatibility.

ethomas08’s picture

StatusFileSize
new1.02 KB

Re-rolled for Drupal 9.2.13 using field_group 8.x-3.2 release.

ethomas08’s picture

StatusFileSize
new1.02 KB

Wrong patch before. Adding correct one.

ethomas08’s picture

anybody’s picture

Hi, just saw Damien set this RTBC in february, what's the plan here to proceed from maintainer side?

Is this planned to be committed or to wait for #3056089: Provide a new render element for accordion?

klemendev’s picture

This is RTBC for a while now, and we are using the patch in production without issues. Any plans to get this into a stable release?

bygeoffthompson’s picture

+1 for a stable release. The patch from #11 works as expected on my Drupal 9 websites

nils.destoop’s picture

Status: Reviewed & tested by the community » Fixed

Thx for the patch, this has been committed to the dev

joelpittet’s picture

Sweet! Thanks for committing this, I was about to create this issue

scotwith1t’s picture

Another +1 for a new stable release which includes this. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jwilson3’s picture

Yes. Please a stable release. I feel like many including myself have been on 3.x-dev on production for a while now.

berdir’s picture

Note: The patch here was actually incorrect/incomplete. This did not consider field_group_library_info_alter() which did already dynamically change or remove that dependency.

rkelbel48’s picture

This is an old issue, but I am still seeing this dependency as a warning in my site since adding Field Group.

Is there a plan to remove this dependency altogether so we can stop seeing this warning in our Site Status Report?