Skip to content
Snippets Groups Projects
Commit 8e2ffb81 authored by Vladimir Roudakov's avatar Vladimir Roudakov
Browse files

Issue #3195698: Hide the unpublished terms for node form

parent e6d8d29a
No related branches found
No related tags found
1 merge request!29Hide the unpublished terms for node form
Pipeline #386333 passed with warnings
......@@ -281,7 +281,7 @@ function _term_reference_tree_get_children($tid, $vid) {
$query = \Drupal::database()
->select($table, $alias);
$query->join('taxonomy_term__parent', 'p', 't.tid = p.entity_id');
$query->fields('t', ['tid', 'name']);
$query->fields('t', ['tid', 'name', 'status']);
$query->addField('t', 'vid', 'vocabulary_machine_name');
$query
->condition('t.vid', $vid)
......@@ -380,7 +380,9 @@ function _term_reference_tree_build_level($element, $term, $form_state, $value,
$container['#level_start_minimized'] = $depth > 1 && $element['#start_minimized'] && !($term->children_selected);
foreach ($term->children as $child) {
$container[$child->tid] = _term_reference_tree_build_item($element, $child, $form_state, $value, $max_choices, $parent_tids, $container, $depth);
if ($child->status == 1) {
$container[$child->tid] = _term_reference_tree_build_item($element, $child, $form_state, $value, $max_choices, $parent_tids, $container, $depth);
}
}
return $container;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment