Problem/Motivation

The below error log appears when the module is enabled in core version 9.x

User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_checkbox_tree(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'term_reference_tree', 'module', 'term_reference_tree', 'modules/contrib/term_reference_tree') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:runtime:seven', Object, Object, Array, 1) (Line: 260)
Drupal\Core\Theme\Registry->getRuntime() (Line: 142)
Drupal\Core\Theme\ThemeManager->render('file_upload_help', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 264)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement(Object, 0, Array, Array, Object) (Line: 143)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 162)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 116)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 178)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_checkbox_tree_level(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'term_reference_tree', 'module', 'term_reference_tree', 'modules/contrib/term_reference_tree') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:runtime:seven', Object, Object, Array, 1) (Line: 260)
Drupal\Core\Theme\Registry->getRuntime() (Line: 142)
Drupal\Core\Theme\ThemeManager->render('file_upload_help', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 264)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement(Object, 0, Array, Array, Object) (Line: 143)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 162)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 116)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 178)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_checkbox_tree_item(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'term_reference_tree', 'module', 'term_reference_tree', 'modules/contrib/term_reference_tree') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:runtime:seven', Object, Object, Array, 1) (Line: 260)
Drupal\Core\Theme\Registry->getRuntime() (Line: 142)
Drupal\Core\Theme\ThemeManager->render('file_upload_help', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 264)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement(Object, 0, Array, Array, Object) (Line: 143)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 162)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 116)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 178)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_checkbox_tree_label(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'term_reference_tree', 'module', 'term_reference_tree', 'modules/contrib/term_reference_tree') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:runtime:seven', Object, Object, Array, 1) (Line: 260)
Drupal\Core\Theme\Registry->getRuntime() (Line: 142)
Drupal\Core\Theme\ThemeManager->render('file_upload_help', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 264)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement(Object, 0, Array, Array, Object) (Line: 143)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 162)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 116)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 178)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_term_tree_list(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'term_reference_tree', 'module', 'term_reference_tree', 'modules/contrib/term_reference_tree') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:runtime:seven', Object, Object, Array, 1) (Line: 260)
Drupal\Core\Theme\Registry->getRuntime() (Line: 142)
Drupal\Core\Theme\ThemeManager->render('file_upload_help', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 264)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement(Object, 0, Array, Array, Object) (Line: 143)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 162)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 116)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 178)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

1. Enable all messages in /admin/config/development/logging
2. Enable this module

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

dravenk created an issue. See original summary.

nicrodgers’s picture

Assigned: Unassigned » nicrodgers
nicrodgers’s picture

Assigned: nicrodgers » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.07 KB

Here's an initial patch for review.
I think _term_reference_tree_output_list_level() would benefit from being refactored in to its own theme function, but figure that's outside the scope of this issue so have left it as-is.

nicrodgers’s picture

StatusFileSize
new9.1 KB

Whoops, ignore the last patch. I forgot to add the new twig templates.

nicrodgers’s picture

Title: Remove User deprecated function » Remove deprecated theme functions
nicrodgers’s picture

Assigned: Unassigned » nicrodgers
Status: Needs review » Needs work

Still missing one template. Git nightmare.

nicrodgers’s picture

Assigned: nicrodgers » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.59 KB

And here with the missing template too...

dasjo made their first commit to this issue’s fork.

chandraraj’s picture

@nicrodgers

Thanks for the patch. But it couldn't be applied for Drupal 9 due to merging error. Would be great if you could look into it.

Thanks,
Chandra

mistrae’s picture

Here is a revision of the patch I made with the module latest version

mistrae’s picture

I forgot the template files

mistrae’s picture

removing previous patch

jaydub’s picture

I can confirm the latest patch applies cleanly to latest 8.x code.

waako’s picture

Status: Needs review » Needs work

The patch from #12 does apply cleanly, but it appears to cause a regression to the "Select parents automatically" option:

With the patch applied:

  1. Assume content type, with Taxonomy Term Reference field
  2. on Manage form display, field widget set to Term reference tree
  3. Field widget settings, enable Select parents automatically
  4. On create/edit node: selecting a child term no longer automatically selects the parent term
waako’s picture

Status: Needs work » Needs review
StatusFileSize
new8.92 KB
new359 bytes

It appears issue was just caused by the div in checkbox-tree.html.twig not wrapping the children so the javascript behaviours that target the .term-reference-tree class no longer applied.

Here is updated patch file, with div wrapping fixed.

greenskin’s picture

Status: Needs review » Needs work

Error's gone, but when using the "Term Reference Tree" as a display formatter, the HTML is rendered as a string. The `template_preprocess_term_tree_list()` function renders the children output to a string. Preferably this should be a render array, but a quick fix is to use Twig's raw filter in the "term-tree-list.html.twig" template.

aaronpinero’s picture

I created an updated version of the patch from #16 with the modification that @greenSkin suggested in #17. This patch applied cleanly, appears to resolve the deprecated theme functions error, and seems to preserve proper function and display of the taxonomy term tree in both the node edit form and the node display.

That said, using the Twig raw filter is probably not a really good idea, so I would consider this a temporary fix. I don't really have the knowledge needed to change template_preprocess_term_tree_list to provide a render array in place of a string.

ronaldmulero’s picture

The patch in #16 works for me.

  1. No errors when term_reference_tree enabled.
  2. No errors when using the term_reference_tree widget in a content type.
  3. Selecting a nested term in the widget renders correctly on page view.

Drupal core 9.2.2
Taxonomy Term Reference Tree Widget 8.x-1.0

texas-bronius’s picture

I am watching and testing, too. Just wanted to add that with the https://www.drupal.org/project/upgrade_status module enabled:

$ drush upgrade_status:analyze term_reference_tree
 [notice] Processing /.../web/modules/contrib/term_reference_tree.

================================================================================
Term Reference Tree, --
Scanned on Wed, 07/28/2021 - 18:27

FILE: web/modules/contrib/term_reference_tree/term_reference_tree.module

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 20   The module is defining "theme_checkbox_tree" theme function.
                    Theme functions are deprecated. For more info, see          
                    https://www.drupal.org/node/2575445.                        
--------------------------------------------------------------------------------
Check manually 24   The module is defining "theme_checkbox_tree_level" theme    
                    function. Theme functions are deprecated. For more info, see
                    https://www.drupal.org/node/2575445.                        
--------------------------------------------------------------------------------
Check manually 28   The module is defining "theme_checkbox_tree_item" theme     
                    function. Theme functions are deprecated. For more info, see
                    https://www.drupal.org/node/2575445.                        
--------------------------------------------------------------------------------
Check manually 32   The module is defining "theme_checkbox_tree_label" theme    
                    function. Theme functions are deprecated. For more info, see
                    https://www.drupal.org/node/2575445.                        
--------------------------------------------------------------------------------
Check manually 36   The module is defining "theme_term_tree_list" theme         
                    function. Theme functions are deprecated. For more info, see
                    https://www.drupal.org/node/2575445.                        
--------------------------------------------------------------------------------

Drupal 9 compatible.

This is just a quick reference that runs on existing D8 to shortcut @dravenek's original issue description HTR, which would require a D9 install to experience.

texas-bronius’s picture

Per good comments #17 and #18, here's the patch from #16 updated from hand-crafted html string to standard Drupal render array.

I did not test extensively, just my own use case. Please review :)

Any ideas why when uploading a patch to this queue we get the option to "test with" 7.x only and not 8.x to which this patch (and queue) pertain?

texas-bronius’s picture

Status: Needs work » Needs review

Liam Morland made their first commit to this issue’s fork.

liam morland’s picture

Updated merge request to latest development branch and added patch from #21.

liam morland’s picture

When I added the patch in #21 to the merge request, I missed adding the new template files. My latest commit adds those. With this change, the merge request now has all the changes from patch #21. These commits can be squashed on merge.

liam morland’s picture

Any ideas why when uploading a patch to this queue we get the option to "test with" 7.x only and not 8.x to which this patch (and queue) pertain?

If you go to the project page and click "Automated testing" you will see that there are no tests configured to run for D8. The project maintainer needs to add tests there before they will show up here.

hoporr’s picture

Patch #21 installed: seems to work

liam morland’s picture

Status: Needs review » Reviewed & tested by the community
crutch’s picture

+1 confirmed #21 fixes this issue

gngn’s picture

#21 worked for me too.

andeersg’s picture

#21 Worked for me too.

kreynen’s picture

#21 is working for me as well.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.