Problem/Motivation

When the trash module is installed on a Drupal core site or a Drupal CMS site, you cannot install the facets module.

I get:

The website encountered an unexpected error. Try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "facets_facet" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 171 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Drupal\trash\TrashEntityTypeManager->getDefinition() (Line: 74)
Drupal\trash\TrashEntityTypeManager->getHandler() (Line: 62)
Drupal\trash\TrashEntityTypeManager->getStorage() (Line: 37)
Drupal\facets\Plugin\Block\FacetBlockDeriver::create() (Line: 25)

You cannot install facets through the UI or Drush.

You get the same error with WebFlorm, but I can install it through Drush.

If you install trash before canvas, you cannot install Canvas. You get the following error:

The website encountered an unexpected error. Try again later.

Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException: The Drupal\canvas\Entity\Component class does not correspond to an entity type. in Drupal\Core\Entity\EntityTypeRepository->getEntityTypeFromClass() (line 111 of core/lib/Drupal/Core/Entity/EntityTypeRepository.php).
Drupal\Core\Entity\EntityBase::loadMultiple() (Line: 115)
Drupal\canvas\ComponentSource\ComponentSourceManager->generateComponents() (Line: 46)
Drupal\canvas\Block\BlockManagerDecorator->clearCachedDefinitions() (Line: 56)
Drupal\Core\Plugin\CachedDiscoveryClearer->clearCachedDefinitions() (Line: 353)
Drupal\Core\Extension\ModuleInstaller->doInstall() (Line: 229)
Drupal\Core\Extension\ModuleInstaller->install() (Line: 186)
Drupal\system\Form\ModulesListConfirmForm->submitForm() (Line: 108)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 45)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 620)
Drupal\Core\Form\FormBuilder->processForm() (Line: 343)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->start() (Line: 639)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 30)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 71)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 753)
Drupal\Core\DrupalKernel->handle() (Line: 34)
Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (Line: 32)
require('/var/www/html/vendor/autoload_runtime.php') (Line: 22)
require_once('/var/www/html/web/autoload_runtime.php') (Line: 13)

Steps to reproduce

* Install the drupal_cms_starter site template and try downloading and installing facets.

* Install core Drupal and install trash first, then facets

CommentFileSizeAuthor
#7 2026-10-01_12-53-51.jpg90.44 KBivan zugec

Issue fork trash-3624638

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

ivan zugec created an issue. See original summary.

ivan zugec’s picture

Issue summary: View changes
ivan zugec’s picture

Issue summary: View changes
loopduplicate’s picture

I attempted to reproduce using the second stated way: "Install core Drupal and install trash first, then facets".

I couldn't reproduce it that way.

My Exact Steps:

  • Install Drupal standard profile 11.4.7
  • Install the Trash module 3.1.x
  • Install the Facets module 3.0.7

There were no errors in the log either.

ivan zugec’s picture

I'll try and debug further tomorrow.

In the meantime, here's my setup:

DDEV v1.25.3
Drupal 11.4.7
nginx/1.26.3
php 8.4.22

drupal/trash 3.1.0
drupal/facets 3.0.7

amateescu’s picture

Status: Active » Postponed (maintainer needs more info)

The additional debug info would be great :)

ivan zugec’s picture

StatusFileSize
new90.44 KB

Sorry for the late response.

I was able to replicate on drupalforge.

https://www.drupalforge.org/template/haven

Install the haven site template and switch on "Browser Based VS Code IDE" so you can install modules.

Then I run the following commands in VSC terminal (in the browser):

- composer require drupal/facets
- drush en facets

Then I got:

www@prod-6f274f-f170e3-k4yu1jjj42lh-7996fb7576-7jwb7:/var/www/html$ drush en facets

In EntityTypeManager.php line 171:
                                                  
  The "facets_facet" entity type does not exist.  

When I go to any page, I get:

The website encountered an unexpected error. Try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "facets_facet" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 171 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Drupal\trash\TrashEntityTypeManager->getDefinition('facets_facet') (Line: 74)
Drupal\trash\TrashEntityTypeManager->getHandler('facets_facet', 'storage') (Line: 62)
Drupal\trash\TrashEntityTypeManager->getStorage('facets_facet') (Line: 124)
Drupal\facets\FacetManager\DefaultFacetManager->__construct(Object, Object, Object, Object, Object, Object) (Line: 262)
Drupal\Component\DependencyInjection\Container->createService(Array, 'facets.manager') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('facets.manager') (Line: 203)
Drupal::service('facets.manager') (Line: 264)
facets_system_breadcrumb_alter(Object, Object, Array) (Line: 460)
Drupal\Core\Extension\ModuleHandler->alter('system_breadcrumb', Object, Object, Array) (Line: 99)
Drupal\Core\Breadcrumb\BreadcrumbManager->build(Object) (Line: 67)
Drupal\system\Plugin\Block\SystemBreadcrumbBlock->build() (Line: 35)
gin_preprocess_top_bar(Array, 'top_bar', Array) (Line: 523)
Drupal\Core\Theme\ThemeManager->invoke('gin', 'preprocess_top_bar', Array) (Line: 311)
Drupal\Core\Theme\ThemeManager->{closure:Drupal\Core\Theme\ThemeManager::render():293}('gin_preprocess_top_bar') (Line: 340)
Drupal\Core\Theme\ThemeManager->render('top_bar', Array) (Line: 504)
Drupal\Core\Render\Renderer->doRender(Array, Object) (Line: 253)
Drupal\Core\Render\Renderer->doRenderRoot(Array, Object) (Line: 143)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::renderInIsolation():142}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->start() (Line: 639)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation(Array) (Line: 169)
Drupal\Core\Render\Renderer->doRenderPlaceholder(Array) (Line: 764)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::replacePlaceholders():763}()
Fiber->start() (Line: 772)
Drupal\Core\Render\Renderer->replacePlaceholders(Array) (Line: 265)
Drupal\Core\Render\Renderer->doRenderRoot(Array, Object) (Line: 143)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::renderInIsolation():142}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->start() (Line: 639)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation(Array) (Line: 113)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 260)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->renderPlaceholders(Object) (Line: 58)
Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments(Object) (Line: 106)
Drupal\canvas\Render\ImportMapResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object) (Line: 254)
Symfony\Component\EventDispatcher\EventDispatcher::{closure:Symfony\Component\EventDispatcher\EventDispatcher::optimizeListeners():249}(Object, 'kernel.response', Object) (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'kernel.response', Object) (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object, 'kernel.response') (Line: 216)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 204)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 30)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 92)
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: 71)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 753)
Drupal\Core\DrupalKernel->handle(Object) (Line: 34)
Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (Line: 32)
require('/var/www/html/vendor/autoload_runtime.php') (Line: 22)
require_once('/var/www/html/web/autoload_runtime.php') (Line: 13)
ivan zugec’s picture

Status: Postponed (maintainer needs more info) » Active

amateescu’s picture

Status: Active » Needs review

Thanks, I could reproduce it on a stock Drupal CMS + Haven site with drush en facets.

Trash's entity_type.manager decorator moved the entity type manager late in plugin.cache_clearer's list, after Canvas's block manager. Canvas rebuilds its block components when that cache is cleared, so during a module install the Facets block deriver (or Canvas itself) sees the entity type definitions from before the install. The fix makes the decorator clear first again.

rajab natshah’s picture

facing the same issue, thanks for the MR

  • amateescu committed 509503b4 on 3.1.x
    fix: #3624638 Get "The "facets_facet" entity type does not exist" when...
amateescu’s picture

Status: Needs review » Fixed

I'll take #11 as having tested the MR and that it works :)

Merged into 3.1.x, thanks for the report and for testing it!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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