Problem/Motivation
Error showing horizontal tabs
Error jquery is Uncaught TypeError: Cannot read properties of undefined (reading 'attach')
Update drupal 9.4.1 to drupal 9.4.2 and display error
Issue fork field_group-3300332
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nelo_drup commentedUpdate reviewing the error a little more, I verify that the horizontal-tabs.js file does not have the necessary context to search for the following attributes in:
$(context).find('[data-horizontal-tabs]').once('horizontal-tabs').each(function() {}
That's why nothing is found in
if (!$($details[0]).hasClass('.collapse-processed')) {
Drupal.behaviors.collapse.attach(context);
}
Comment #3
WebbehRemoving tag.
Comment #4
alex.skrypnykTested this on Drupal 10-beta2
The Hotizontal tabs not working at all and the current JS code relies on `collapse.js` which was removed in D10 - https://www.drupal.org/node/3269082 (change record https://www.drupal.org/node/3285858)
The original Drupal 10 compatibility issue (https://www.drupal.org/project/field_group/issues/3297196) was closed with a comment that `3.x` already works with D10, but that issue has not addressed this depreciation unfortunately.
Leaving this open, tagging and linking D10 compat issue.
Comment #6
swentel commentedInteresting, this works fine here on my local D10 environment, so bit confused.
at least, in the backend it works, how can I reproduce this?
Comment #7
smustgrave commentedTested on a local 9.5 environment
Using claro as my admin theme (as that is now the default)
Latest version of Field group
Created a tabs group
Created 2 tab groups
Added a field under each
Verified the tabs are working fine.
Since this was only moved to PNMI 12 days ago won't close as cannot reproduce but +1 for that.
Would request specific steps for reproducing this issue
Comment #8
alex.skrypnykTo reproduce:
1. Install D10 beta2 with Claro enabled as an admin theme
2. Install Field Group from 3.x-dev
3. Create fields in content type and place them in the hotizontal tabs
4. Navigate to the content type edit form and observe the error.
In D10 there is no more `collapse.js` as it has been removed from core - see https://www.drupal.org/node/3285858
The MR is removing these lines:
`Drupal.behaviors.collapse` does not exist anymore in D10.
It may be that some themes use `collapse--processed` instead of `collapse-processed` class and this code is not fired.
Comment #9
smustgrave commentedAh there it is.
Thanks for the detailed steps.
Comment #10
swentel commentedHmm yeah, I see it now as well, and works again with those lines removed, so great!
@smustgrave did you test on D9 with those lines remove, just double checking?
Comment #11
smustgrave commentedDid not test in D9 with the patch. Suppose if the removal causes issues we can just wrap the whole thing in an if check
Comment #13
swentel commentedWas able to test myself quickly, still works fine on D9 too (even on D9.2 and D9.1)
merged, thanks!