I was trying to use the Parent Term ID limit, I had no chance to get it working, I guess it is due to this:

$element['#parent_tid'] = $settings['parent_term_id'] || $field['settings']['allowed_values'][0]['parent'];

shoud be

$element['#parent_tid'] = $settings['parent_term_id'] ? $settings['parent_term_id'] : $field['settings']['allowed_values'][0]['parent'];

As the first is always returning 1

After patching the feature is working correctly.
Thanks for this very useful mudule.

CommentFileSizeAuthor
term_reference_tree.widget.inc_.patch893 bytesmarco.giaco
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

enekid’s picture

The patch works!

Thank you. It shows correctly the subtree.

But testing the functionality I got a question.

Supose we have this taxonomy

A
-B
--C
X

And have as "Parent Term ID limit" 'A' and the "Select parents automatically" checked. If we check 'C' now we get also 'B' added, but not 'A'. ¿Shouldn't 'A' also be added?

Hephaestus’s picture

Thanks for the patch! Works for us.

OnkelTem’s picture

Thanks for the patch!

p.s. Why it is not committed yet?

DuaelFr’s picture

The answer to #1 is "No" (I just made the test)

I think we may open a new issue to relate this problem.

inky@inky3d.com’s picture

Patch worked for me too.

DuaelFr’s picture

Status: Active » Reviewed & tested by the community

Let's mark it as RTBC :)

DuaelFr’s picture

Separate issue for the automatic selection of parent terms in a filtered tree :
#1679438: Allow parents automatic selection on filtered widgets

Taxoman’s picture

#1/#4: Created separate issue here:
#1679470: Option to include all parents

sokrplare’s picture

The patch worked perfect for me with a fairly sizable list - thanks!

natuk’s picture

Works over here as well. Thanks.

Zuzuesque’s picture

Tested and worked for us. Thanks for the patch!

Aron Novak’s picture

I can also confirm that the patch just works.

askibinski’s picture

I can also confirm this patch works.

jaydub’s picture

Confirmed that patch fixed issue for me as well.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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