When checking a child, the parents are automatically selected. When this happens, the code looks from the parent and checks all the boxes down to the child. To do this, is uses this code:

checkbox.parents('ul.term-reference-tree-level li').children('div.form-item').children('input[type=checkbox]').each(function() {

However, this is too brittle. For instance, bootstrap puts checkboxes within label elements. So, we should use find for the inputs, not children. e.g.

checkbox.parents('ul.term-reference-tree-level li').children('div.form-item').find('input[type=checkbox]').each(function() {

Patch attached.

Comments

dave reid’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
dave reid’s picture

Issue summary: View changes

typo

duaelfr’s picture

Rerolled.
Be careful, this patch conflicts with the one posted in #2271719-3: Broken when using jQuery 1.9 and 1.10

vladimiraus’s picture

Status: Needs review » Closed (outdated)

Thank you everyone for your contribution.
Drupal 7 is no longer supported but we always need support for Drupal 11 version.
Closing as outdated.

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.