Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck().
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3348861. -->
Reported by: [generalredneck](https://www.drupal.org/user/368854)
Related to !16
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/drd/-/work_items/3348857" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/drd/-/work_items/3348857</a></span> I was asking for support and went and xdebugged the code. Learned some things about how the updater works. That said, There were a couple places where an entityquery was created where accessCheck() wasn't used and it was throwing an exception, but that exception was being caught by the try catch there. this was causing the most up to date information to not be grabbed from D.O for Drupal 10. This was introduced in 9.2 and enforced with an exception in 10.0. see <a href="https://www.drupal.org/node/3201242">https://www.drupal.org/node/3201242</a></p>
<p><img src="https://www.drupal.org/files/issues/2023-03-18/Screenshot%20from%202023-03-18%2012-16-56.png" alt="IDE"></p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add accessCheck() to each instance of entityQuery in the codebase.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
> Related issue: [Issue #3348857](https://www.drupal.org/node/3348857)
issue