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
API changes
Data model changes