Problem/Motivation
The website encountered an unexpected error. Try again later.
Error: Call to undefined method Symfony\Component\HttpFoundation\RequestStack::get() in Drupal\taxonomy_term_depth\Form\DepthUpdateForm->buildForm() (line 58 of modules/contrib/taxonomy_term_depth/src/Form/DepthUpdateForm.php).
call_user_func_array() (Line: 528)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Steps to reproduce
push to Update term depths
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork taxonomy_term_depth-3512691
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
sergey2006 commentedI've changed
$vocabulary = $this->request->get('taxonomy_vocabulary');
to
$vocabulary = \Drupal::request()->get('taxonomy_vocabulary');
and voila!
but have some other issue with sub-terms which cant read and show in menu
i have PHP 8.13.17 and symfony 7.2
Comment #3
liam morlandThat line used to have
\Drupal::request()but it was replaced with the move to dependency injection. It looks like the dependency injection was not done correctly. See commit 44cf6b9.Comment #5
liam morlandPlease try this fix.
Comment #6
sergey2006 commentedThis fix " $vocabulary = $this->request->getCurrentRequest()->get('taxonomy_vocabulary'); "
works fine!
Thank you.
But still cant find problem with sub-terms :(
Why they are not appearing in site taxonomy menu?
Comment #8
liam morlandPlease open a separate ticket for the other issue. If that problem does not appear in 8.x-2.6, please see if you can find the commit that broke it (use
git bisect).