Problem/Motivation

Taxonomy terms are fieldable. That means that they could consist of way more information than name and tid.

Using hook_query_term_reference_tree_get_children_alter() you can easily add these fields and their values to the term objects that are used to build the tree.

It would be nice to still have access to these fields in hook_preprocess_checkbox_tree_item() and the corresponding template!

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 3346954_4.patch721 bytesmkalkbrenner
#2 3346954.patch1.18 KBmkalkbrenner

Comments

mkalkbrenner created an issue. See original summary.

mkalkbrenner’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB
mkalkbrenner’s picture

+++ b/term_reference_tree.module
@@ -414,13 +419,11 @@ function _term_reference_tree_build_item($element, $term, $form_state, $value, $
-    if (is_array($e)) {

This check is not needed because $e is initialized as array directly above:

$e = [ ... ];

That's why I removed the not required if statement here, just because I recognized it.

mkalkbrenner’s picture

re-roll

mkalkbrenner’s picture

StatusFileSize
new721 bytes