Fix PHPStan L1 error "Relying on entity queries to check access by default is deprecated..."

Created on 4 January 2023, almost 2 years ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

With the version bump of mglaman/phpstan-drupal in πŸ“Œ Fix failing "updated deps" test-runs by upping mglaman/phpstan-drupal to latest Fixed some Entity Query access check-related errors popped up and were committed to the baseline core/phpstan-baseline.neon.

This issue aims to fix all those errors, which manifest themselves as:

Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
πŸ’‘ See https://www.drupal.org/node/3201242 β†’

As it turns out there is still a problem with mglaman/phpstan-drupal relating to accesCheck(), config entities and count queries, see https://github.com/mglaman/phpstan-drupal/issues/530.
Therefore there are still occurrences of the above errors present in the baseline. These should all be about count queries.

Steps to reproduce

Proposed resolution

- There should be no more of the above mentioned errors being suppressed in the baseline.
- TestBot should return green.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.1 ✨

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡³πŸ‡±Netherlands spokje

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024