Issue #3330981: Fix PHPStan L1 error "Relying on entity queries to check access by default is deprecated..."
Closed
requested to merge issue/drupal-3330981:3330981-phpstan-l1-entity-query-access-check into 10.1.x
Merge request reports
Activity
added 1 commit
- 4efb4551 - Fix LayoutBuilderIsActiveCacheContextTest test failure
- Resolved by spokje
434 424 message: "#^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\\.$#" 435 425 count: 1 436 426 path: lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php 437 427 - Comment on lines 433 to 437
I can only make this pass when the
->accessCheck(TRUE)
is just before the->execute();
. Putting it before->count()
it fails.I got the feeling this is related to https://github.com/mglaman/phpstan-drupal/issues/494
changed this line in version 13 of the diff
- Resolved by spokje
1728 1713 - 1729 1714 message: "#^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\\.$#" 1730 1715 count: 1 1731 1716 path: modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php - Comment on lines 1728 to 1731
False negative, access is checked. (See https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php#L260)
Looks like another appearance of https://github.com/mglaman/phpstan-drupal/issues/494
Edited by spokje changed this line in version 13 of the diff
- Resolved by spokje
- Resolved by spokje
- Resolved by spokje
- Resolved by spokje
added 207 commits
-
58cbc540...21d40b75 - 199 commits from branch
project:10.1.x
- c680c593 - WiP
- df67cfd0 - Fix LayoutBuilderIsActiveCacheContextTest test failure
- 0f6fe823 - WiP
- e0977704 - WiP
- f9d40491 - All fixed what can be fixed
- 205fd14d - Added accessCheck mock
- 6c70bf49 - Fixing merge victims.
- abaf8bd6 - Fixing PHPStan error
Toggle commit list-
58cbc540...21d40b75 - 199 commits from branch
Please register or sign in to reply