keep term details in elements array for 3rd party modifications

Created on 9 March 2023, over 1 year ago

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

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mkalkbrenner
  • Status changed to Needs review over 1 year ago
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
    +++ 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.

Production build 0.69.0 2024