Closed (fixed)
Project:
Date Content Augmenter
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Jun 2023 at 19:32 UTC
Updated:
1 Dec 2023 at 14:04 UTC
Jump to comment: Most recent
When trying to display content that uses this module throws the following error:
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 /var/www/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
Looks like it's in Content.php in this query
$query = \Drupal::entityQuery('date_content')
->condition('type', $bundle)
->condition('parent_id', $entity->id())
->condition('parent_type', $entity->getEntityTypeId())
->condition('field_name', $field_name)
->condition('field_delta', $options['delta'])
$existing = $query->execute();
MR headed your way here in a minute.
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
Comment #3
mandclu commentedComment #5
keshavv commentedIt was missing one another
entityQueryAdded that into MR as well.
Comment #6
dgwolf commentedSeems the issue comes up here as well after upgrading to D10. Any news about the patch? Best, Andreas
Here's my error message on a newly updated Drupal install (9.5.11 -> 10.1.4) when trying to view an event as product in commerce:
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: 86)
Drupal\date_content\Plugin\DateAugmenter\Content->augmentOutput() (Line: 835)
Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDefaultFormatter->augmentOutput() (Line: 155)
Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDefaultFormatter->viewElements() (Line: 89)
Drupal\Core\Field\FormatterBase->view() (Line: 265)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() (Line: 268)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() (Line: 339)
Drupal\Core\Entity\EntityViewBuilder->buildComponents() (Line: 281)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 238)
Drupal\Core\Entity\EntityViewBuilder->build()
call_user_func() (Line: 37)
Drupal\commerce_product\ProductVariationFieldRenderer->renderFields() (Line: 60)
Drupal\commerce_product\ProductVariationFieldRendererLayoutBuilder->renderFields() (Line: 96)
Drupal\commerce_product\ProductViewBuilder->alterBuild() (Line: 291)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 238)
Drupal\Core\Entity\EntityViewBuilder->build()
call_user_func_array() (Line: 111)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 797)
Drupal\Core\Render\Renderer->doCallback() (Line: 386)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 239)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 187)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch() (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup() (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 270)
Drupal\shield\ShieldMiddleware->bypass() (Line: 226)
Drupal\shield\ShieldMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Comment #7
dgwolf commentedHad issues with my upgrade from D 9.5.11 to 10.1.14 but after a clean replay of the upgrade the problem persists. Using the module makes the page using it crash with said error messages. Unchecking "Enabled Date Augmenters" - "Content" in the display section of the page's Smart Date field disables the module and the page loads properly.
Comment #8
mandclu commented@dgwolf did you try patching it with the changes in the MR?
Comment #9
dgwolf commentedThanks for encouraging me to try the patch. It works, the page loads without a glitch. +1 for the MR!
Comment #11
mandclu commentedI'll take that feedback as an RTBC, so merged in the changes. Will roll a new release shortly.