I have an update on http://drupal.org/node/856310

If I edit a node that contains a hierarchical vocabulary and terms at a deep level are selected, the form element is displayed as a collapsed fieldset, thus not showing the selected terms from the deep level.

Is there a way to automatically open all parental fieldsets of selected terms?

A solutions was found and and a patch committed (http://drupal.org/node/856310#comment-3520600).

But the problem was only partially solved. Reason The solution worked only for one level of hierarchy, because the patch only opens the direct parent fieldset of a selected term. It does not work, if you have more then one level of hierarchy.

I studied the issue with and found a solution, which propagates the opened fieldsets to uplevel fieldsets.

Please try the attached patch on vocabularies with hierarchies of more than one level.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcisio’s picture

I haven't tested, but it looks like having logic problem:

propagates the opened fieldsets to uplevel fieldsets

Two problems:
- Propagation is only 1-level up
- Is the 'collapsed' attribute of child fieldset correctly set at the check time?

PS: I prefer the old issue re-open. BTW, as there is a patch, we'll continue here.

ducdebreme’s picture

Referring to Your points ...

- Propagation is only 1-level up

No, that's not right. It really works recursively bottom up over all levels. The section which is marked with the comment "check, if child is a fieldset and if it is open (not collapsed)" propagates the opening of a deeper fieldset to its parent fieldsets. And parent fieldsets itself are evaluated after their child fieldsets. Therefore this works.

My last point is also answers Your second question ...

- Is the 'collapsed' attribute of child fieldset correctly set at the check time?

... and the answer is YES, IT DOES.

For me it would be OK to reopen the old issue.

jcisio’s picture

Status: Needs review » Fixed

Ok, now I have a chance to test and indeed, it works ;)

Thanks, ducdebreme. Patch committed.

Status: Fixed » Closed (fixed)
Issue tags: -expand, -parent terms

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