Problem/Motivation

Drupal\Core\Entity\Query\QueryException: 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\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 70)
Drupal\services\Plugin\ServiceDefinition\EntityIndex->processRequest(Object, Object, Object) (Line: 68)
Drupal\services\Controller\Services->processRequest(Object, Object, 'second_endpoint', 'entity_index:node')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
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: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 45)
Drupal\services\StackMiddleware\FormatSetter->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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Issue fork services-3385265

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

holdmann created an issue. See original summary.

holdmann’s picture

fix for (index) method, others not checked

sarwan_verma made their first commit to this issue’s fork.

sarwan_verma’s picture

Status: Active » Needs review
anybody’s picture

Priority: Normal » Major

@sarwan_verma and @holdmann are you sure that the (risky) value of FALSE is correct?
Are there similar places in code, where the same is done as reference?

Settings this to major as it's super important to be fixed for Drupal 10 to not give an error!

anybody’s picture

Version: 5.0.0-beta7 » 5.x-dev

I decided to change ->accessCheck(TRUE) to ->accessCheck(FALSE) for security reasons unless there are good reasons to allow access to all entities.

Please review!

jcnventura made their first commit to this issue’s fork.

jcnventura’s picture

Status: Needs review » Fixed
jcnventura’s picture

  • jcnventura committed 758b247e on 5.x
    Issue #3385265 by jcnventura: Access checking must be explicitly...

  • jcnventura committed 32d4e11b on 5.x
    Revert "Issue #3385265 by jcnventura: Access checking must be explicitly...

Status: Fixed » Closed (fixed)

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