The "" entity type does not exist

Created on 24 July 2020, almost 5 years ago
Updated 9 June 2025, 22 days ago

Problem/Motivation

When we use group with presented entity access layer, we face the next error.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
group_query_entity_query_alter(Object) (Line: 271)
group_query_views_entity_query_alter(Object, NULL, NULL) (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('query', Object) (Line: 480)
Drupal\Core\Database\Query\Select->preExecute() (Line: 1491)
Drupal\views\Plugin\views\query\Sql->execute(Object) (Line: 357)
Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->populateQueue(Array) (Line: 188)
Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->getLabels(Array) (Line: 66)
Drupal\views_bulk_operations\Form\ConfirmAction->addListData(Array) (Line: 46)
Drupal\views_bulk_operations\Form\ConfirmAction->getFormData('fut_group_posts_management', 'page_1') (Line: 83)
Drupal\views_bulk_operations\Form\ConfirmAction->buildForm(Array, Object, 'fut_group_posts_management', 'page_1')
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('views_bulk_operations_confirm_action', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
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: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

After investigation, I have found that we set entity_type metadata and build views query, but VBO module adds custom conditions and builds again the query. So, metadata information is gone after.
I am trying to find the way to do it different way.

Steps to reproduce

Given that group, gnode and VBO modules are enabled
And a group type had been created
When a new group been created
And the site directed us to the member page
Or browsing any page in the site
Then we run into this issue

Proposed resolution

Only as a precaution.

Have a fix in case that other custom or contrib modules are changing query of entities.

Having the try catch to wrap the code is better

    try {

    }
    catch (PluginNotFoundException $e) {

    }

Remaining tasks

User interface changes

  • None

API changes

  • None

Data model changes

  • None
πŸ› Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium lobsterr

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States firewaller

    I don't want to reopen this, but I did want to post the re-rolled patch for 3.3. I know the module maintainer doesn't want to support this and I understand why, but in case this is a blocking issue for anybody else I figured I'd upload it.

Production build 0.71.5 2024