Problem

I have installed LikeIt on Drupal 10.
I get errors when I try to delete entity :

Here is the detailed error I get when I try to delete an Article :

Drupal\Core\Entity\EntityStorageException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 761 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 573)
Drupal\likeit\LikeitHelper->removeFromEntity() (Line: 115)
likeit_entity_delete()
call_user_func_array() (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 903)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 462)
Drupal\Core\Entity\EntityStorageBase->delete() (Line: 751)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (Line: 347)
Drupal\Core\Entity\EntityBase->delete() (Line: 71)
Drupal\Core\Entity\ContentEntityDeleteForm->submitForm()
call_user_func_array() (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 595)
Drupal\Core\Form\FormBuilder->processForm() (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 675)
Drupal\Core\DrupalKernel->handle() (Line: 19)

How can I solve it ?

CommentFileSizeAuthor
#4 3377496-4.patch1.23 KBdheeraj jhamtani

Comments

alex.amtr created an issue. See original summary.

alex.amtr’s picture

Issue summary: View changes
alex.amtr’s picture

I've just managed to uninstall de LikeIt! Module which have never worked on my Drupal 10 (the button like never appeared).
Now I can delete entities normally.

dheeraj jhamtani’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

The error you are encountering is related to the access check not being explicitly set for the entity query when deleting the Likeit entities. To fix this issue, you need to add the accessCheck() method to the entity query. I have created a patch for this please review.