The following error occurs when enabling the TranslateEntityProcessor for a facet of content type:
Error: Call to undefined method Drupal\node\Entity\NodeType::hasTranslation() in Drupal\facets\Plugin\facets\processor\TranslateEntityProcessor->build() (line 125 of modules/contrib/facets/src/Plugin/facets/processor/TranslateEntityProcessor.php).
Drupal\facets\Plugin\facets\processor\TranslateEntityProcessor->build(Object, Array) (Line: 297)
Drupal\facets\FacetManager\DefaultFacetManager->build(Object) (Line: 82)
Drupal\facets\Plugin\Block\FacetBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 151)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 152)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 166)
Drupal\Core\Render\Renderer->renderPlaceholder('', Array) (Line: 659)
Drupal\Core\Render\Renderer->replacePlaceholders(Array) (Line: 544)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 139)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 140)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 258)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->renderPlaceholders(Object) (Line: 131)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.response', Object) (Line: 184)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#3 | 2823545-3.patch | 1.15 KB | mpp |
#2 | 2823545-2.patch | 749 bytes | mpp |
Comments
Comment #2
mpp CreditAttribution: mpp as a volunteer and at AmeXio commentedAttached a quick fix, ideally this would test for the proper interface.
Comment #3
mpp CreditAttribution: mpp as a volunteer and at AmeXio commentedUsing instanceof TranslatableInterface this time.
Comment #5
borisson_Committed, thanks!
Comment #7
Dane Powell CreditAttribution: Dane Powell at Acquia commentedJust for the benefit of anyone else (like me) stumbling across this error and wondering about the cause, this probably occurs most commonly when you delete a taxonomy term that's referenced by a node or other entity. The root cause is that Drupal doesn't delete corresponding term references when you delete the term, leaving dangling tids in those term reference fields. When facets tries to load those missing terms, you get this error.
Comment #8
borisson_Ah, that sounds like a good explanation, thanks @Dane Powell!