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
Comment #2
ragnarkurm commentedComment #3
wellsComment #4
noorulshameera commentedI have verified that the patch was applied successfully and the deprecation message gets removed from the upgrade status report.
Comment #5
keshavv commentedAs it is a simple check and works as expected.
+1 for RTBC
Comment #7
wellsCommitted and included in 4.0.2 -- thanks for the patch and tests!