Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
Nested checkboxes don't work well with jQuery 1.6+ due to prop and attr changes http://api.jquery.com/prop/
- Hit parent item
- Children items won't be ticked off automatically
- Tick off all children items
- Parent item won't be ticked off automatically
- Uncheck one of a children items
- Parent item won't populate proper checked/unchecked state
Solution
Add helper functions to detect jQuery version and upgrade code to reflect this change. Patch is attached.
Comment | File | Size | Author |
---|---|---|---|
#1 | better_exposed_filters-jquery_compatibility-2.patch | 4.35 KB | cr0ss |
better_exposed_filters-jquery_compatibility-1.patch | 3.32 KB | cr0ss |
Comments
Comment #1
cr0ss CreditAttribution: cr0ss as a volunteer and commentedUpdate patch. Major fix is removing .has('ul') from nested checkboxes. Since there could be a parent item without children and it still have to fire submit behavior.
Comment #2
knalstaaf CreditAttribution: knalstaaf commentedSeems to do the job for me!
Comment #3
jenlampton@knalstaaf if you are using the patch and it is working for you then you can change the status to 'Reviewed & tested by the community'. It's working for me too - changing status :)
Comment #4
mikeker CreditAttribution: mikeker as a volunteer commentedSorry, just had time for a super quick visual review and haven't tested this patch yet.
Nitpick: missing "not" or "is less than or equal to 1.6". Also "the" before "version" in this line and the line above.
I would prefer to name this differently since it's not returning the version of jQuery but a bool.
Leftover debug code?
Don't we need an else clause?
Comment #5
Neslee Canil PintoHi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).