Problem/Motivation
Hide the unpublished terms for the node form because the user does not have full permission for the taxonomy, the user can not save the node if he selects an unpublished term
Error: This entity (taxonomy_term: xxx) cannot be referenced.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3195698-Hide-term-form-the-node-if-the-term-4.patch | 1.17 KB | jaydub |
| #3 | 3195698-Hide-term-form-the-node-if-the-term-3.patch | 1.14 KB | firass.ziedan |
Issue fork term_reference_tree-3195698
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
firass.ziedanComment #3
firass.ziedanComment #4
jaydub commentedWhile I agree that the most straightforward way of doing this is by loading the Term entities in question, the current version of the module goes out of its way to NOT load full Term entities per the notes in _term_reference_tree_get_chidren():
Per that note and per keeping things slim if possible, I created another patch that accomplishes the same thing more or less without requiring the full Term entities to be loaded.
Comment #5
maacl commentedPatch still applies, the extending the query looks good. Solved the problem for me.
Comment #9
vladimirausThanks, all.
Committed! 🧁
Comment #10
nicrodgersDiscovered this issue after updating to 2.0.2.
Unfortunately I don't think the change made here is correct. We shouldn't exclude unpublished terms, as the user may well have permission to view and use the unpublished term (the 'administer taxonomy' permission).
I've raised https://www.drupal.org/project/term_reference_tree/issues/3497889