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.
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.
Comment | File | Size | Author |
---|---|---|---|
term_reference_tree.widget.inc_.patch | 893 bytes | marco.giaco | |
Comments
Comment #1
enekid CreditAttribution: enekid commentedThe 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?
Comment #2
Hephaestus CreditAttribution: Hephaestus commentedThanks for the patch! Works for us.
Comment #3
OnkelTem CreditAttribution: OnkelTem commentedThanks for the patch!
p.s. Why it is not committed yet?
Comment #4
DuaelFrThe answer to #1 is "No" (I just made the test)
I think we may open a new issue to relate this problem.
Comment #5
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedPatch worked for me too.
Comment #6
DuaelFrLet's mark it as RTBC :)
Comment #7
DuaelFrSeparate issue for the automatic selection of parent terms in a filtered tree :
#1679438: Allow parents automatic selection on filtered widgets
Comment #8
Taxoman CreditAttribution: Taxoman commented#1/#4: Created separate issue here:
#1679470: Option to include all parents
Comment #9
sokrplare CreditAttribution: sokrplare commentedThe patch worked perfect for me with a fairly sizable list - thanks!
Comment #10
natukWorks over here as well. Thanks.
Comment #11
Zuzuesque CreditAttribution: Zuzuesque commentedTested and worked for us. Thanks for the patch!
Comment #12
Aron NovakI can also confirm that the patch just works.
Comment #13
askibinski CreditAttribution: askibinski commentedI can also confirm this patch works.
Comment #14
jaydub CreditAttribution: jaydub commentedConfirmed that patch fixed issue for me as well.
Comment #15
Dave ReidCommitted to 7.x-1.x. Thanks everyone!
http://drupalcode.org/project/term_reference_tree.git/commit/b561a42