TypeError: preg_match(): Argument #2 ($subject) must be of type string, Drupal\taxonomy\Entity\Term

Created on 18 November 2023, 7 months ago
Updated 14 March 2024, 4 months ago

Problem/Motivation

I get this error when i add a Facets exposed filters

TypeError: preg_match(): Argument #2 ($subject) must be of type string, Drupal\taxonomy\Entity\Term given in preg_match() (line 207 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Drupal\Core\Routing\UrlGenerator->doGenerate(Array, Array, Array, Array, Array, 'entity.taxonomy_term.canonical') (Line: 256)
Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.taxonomy_term.canonical', Object, Array, Array) (Line: 300)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('entity.taxonomy_term.canonical', Array, Array, 1) (Line: 108)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('entity.taxonomy_term.canonical', Array, Array, ) (Line: 765)
Drupal\Core\Url->toString() (Line: 142)
Drupal\views\Form\ViewsExposedForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('views_exposed_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm('\Drupal\views\Form\ViewsExposedForm', Object) (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1253)
Drupal\views\ViewExecutable->build(NULL) (Line: 1406)
Drupal\views\ViewExecutable->execute() (Line: 236)
Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay->fillFacetsWithResults(Array) (Line: 482)
Drupal\facets\FacetManager\DefaultFacetManager->updateResults('search_api:views_page__oto_commerce_product_variation_catalog__page_1') (Line: 269)
Drupal\facets\FacetManager\DefaultFacetManager->processFacets('search_api:views_page__oto_commerce_product_variation_catalog__page_1') (Line: 346)
Drupal\facets\FacetManager\DefaultFacetManager->processBuild(Object) (Line: 420)
Drupal\facets\FacetManager\DefaultFacetManager->build(Object) (Line: 59)
Drupal\facets_exposed_filters\Plugin\views\filter\FacetsFilter->facetsViewsGetFacets() (Line: 129)
Drupal\facets_exposed_filters\Plugin\views\filter\FacetsFilter->valueForm(Array, Object) (Line: 950)
Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm(Array, Object) (Line: 111)
Drupal\views\Form\ViewsExposedForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('views_exposed_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm('\Drupal\views\Form\ViewsExposedForm', Object) (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1253)
Drupal\views\ViewExecutable->build() (Line: 392)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 196)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1645)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 146)
Drupal\tvi\Service\TaxonomyViewsIntegratorManager->getTaxonomyTermView(Object) (Line: 50)
Drupal\tvi\Controller\TaxonomyViewsIntegratorTermPageController->render(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Go to view and add Facets exposed filtes. my URL view is /taxonomy/term/%
Go to taxonomy page

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇹Italy trickfun

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

Comments & Activities

Production build 0.69.0 2024