On Drupal 10.1, sending a newsletter fails with "QueryException: Entity queries must explicitly set whether the query should be access checked or not"

Created on 25 June 2023, over 1 year ago
Updated 25 August 2023, over 1 year ago

Problem/Motivation

After updating to Drupal 10.1.0, when I attempt to send a newsletter, it fails with this backtrace:

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()

Drupal\Core\Entity\Query\Sql\Query::prepare() core/lib/Drupal/Core/Entity/Query/Sql/Query.php:80
Drupal\Core\Entity\Query\Sql\Query::execute() modules/simplenews_stats/src/SimplenewsStatsEntityStorage.php:84
Drupal\simplenews_stats\SimplenewsStatsEntityStorage::getFromRelatedEntity() modules/simplenews_stats/src/SimplenewsStatsEngine.php:195
Drupal\simplenews_stats\SimplenewsStatsEngine::getSimplenewsStats() modules/simplenews_stats/src/SimplenewsStatsEngine.php:155
Drupal\simplenews_stats\SimplenewsStatsEngine::logHitSent() modules/simplenews_stats/src/SimplenewsStatsMailBase.php:203
Drupal\simplenews_stats\SimplenewsStatsMailBase::logHitSent() modules/simplenews_stats/src/SimplenewsStatsMail.php:46
Drupal\simplenews_stats\SimplenewsStatsMail::prepareMail() modules/simplenews_stats/simplenews_stats.module:31
::simplenews_stats_mail_alter() core/lib/Drupal/Core/Extension/ModuleHandler.php:545
Drupal\Core\Extension\ModuleHandler::alter() core/lib/Drupal/Core/Mail/MailManager.php:276
Drupal\Core\Mail\MailManager::doMail() core/lib/Drupal/Core/Mail/MailManager.php:180
Drupal\Core\Mail\MailManager::Drupal\Core\Mail\@closure() core/lib/Drupal/Core/Render/Renderer.php:583
Drupal\Core\Render\Renderer::executeInRenderContext() core/lib/Drupal/Core/Mail/MailManager.php:181
Drupal\Core\Mail\MailManager::mail() modules/mailsystem/src/MailsystemManager.php:70
Drupal\mailsystem\MailsystemManager::mail() modules/simplenews/src/Mail/Mailer.php:329
Drupal\simplenews\Mail\Mailer::sendMail() modules/simplenews/src/Mail/Mailer.php:385
ā€¦

Proposed resolution

Add the now-mandatory access check.

Remaining tasks

Review and merge MR.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

šŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

šŸ‡ŗšŸ‡øUnited States smokris Athens, Ohio, USA

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

Comments & Activities

Production build 0.71.5 2024