Problem/Motivation
The "message subscribe example/email" sub-modules are active and I need to use content moderation/workflow modules. But during a moderation process, for example, when I change the status from draft to published, I get the following error.
php
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->save() (line 817 of /home/jayden/web/j10/public_html/drupal10/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
-----------------
node
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 /home/jayden/web/j10/public_html/drupal10/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
When I deactivate the message subscribe example module or the "node update" section within it, the transition completes successfully.
Of course, node update message cannot be created in this case.
Any ideas of using it with Content Moderation, please ?
Comments
Comment #1
Anonymous (not verified) commentedjaydenpearly created an issue. See original summary.
Comment #2
Anonymous (not verified) commenteda temporary solution that I'm not sure is sufficient. (message_subscribe_example.module)
-----------
Change
$query->condition($field . '.target_id', $entity->id());with
$query->accessCheck(TRUE)->condition($field . '.target_id', $entity->id());Comment #6
bluegeek9 commented