Problem/Motivation

Upgrading to Drupal 10.
Upgrade Status module gives following complaint:

web/modules/contrib/social_auth/social_auth.post_update.php
Line 15
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.

web/modules/contrib/social_auth/social_auth.post_update.php
Line 19
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.

I'd like the report to be clean. I'm not 100% sure if this an actual problem, of false positive.

Steps to reproduce

Install Status Update module, and Social Auth module v4.0.1.
Then scan the code at /admin/reports/upgrade-status
See that there are two issues reported.

Proposed resolution

Before:

/* L15 */ $sandbox['total'] = $storage->getQuery()->count()->execute();
/* L19 */ $ids = $storage->getQuery()->range($sandbox['progress'], 50)->execute();

After:

/* L15 */ $sandbox['total'] = $storage->getQuery()->accessCheck(FALSE)->count()->execute();
/* L19 */ $ids = $storage->getQuery()->checkAccess(FALSE)->range($sandbox['progress'], 50)->execute();

Remaining tasks

If the fix is valid, then commit.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

ragnarkurm created an issue. See original summary.

ragnarkurm’s picture

StatusFileSize
new963 bytes
wells’s picture

Status: Active » Needs review
noorulshameera’s picture

StatusFileSize
new1.12 MB
new1.01 MB

I have verified that the patch was applied successfully and the deprecation message gets removed from the upgrade status report.

keshavv’s picture

Status: Needs review » Reviewed & tested by the community

As it is a simple check and works as expected.
+1 for RTBC

  • wells committed a7eafefa on 4.0.x authored by ragnarkurm
    Issue #3377647 by ragnarkurm, noorulshameera, keshavv: Upgrade_status...
wells’s picture

Status: Reviewed & tested by the community » Fixed

Committed and included in 4.0.2 -- thanks for the patch and tests!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.