Entity queries need an explicit accessCheck()-call in Drupal 10

Created on 11 August 2023, 11 months ago
Updated 3 October 2023, 9 months ago

Problem/Motivation

The "Upgrade Status" -module says the following for several places within the LDAP submodules:

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.

Steps to reproduce

Validate the LDAP-module with "Upgrade Status" and read the report.

Proposed resolution

Add explicit accessCheck()-calls to the entity queries. The following places were detected:

  1. ldap_authentication/src/AuthenticationServers.php 64
  2. ldap_authentication/src/Controller/LoginValidatorBase.php 548
  3. ldap_authentication/src/Form/LdapAuthenticationAdminForm.php 87
  4. ldap_authorization/src/Plugin/authorization/Provider/LDAPAuthorizationProvider.php 117
  5. ldap_query/src/Form/QueryEntityForm.php 51
  6. ldap_servers/ldap_servers.install 61
  7. ldap_servers/ldap_servers.install 98
  8. ldap_servers/ldap_servers.install 147
  9. ldap_servers/src/Form/DebuggingReviewForm.php 150
  10. ldap_servers/src/Form/DebuggingReviewForm.php 165
  11. ldap_servers/src/Form/DebuggingReviewForm.php 180
  12. ldap_servers/src/LdapUserManager.php 164
  13. ldap_user/src/Form/LdapUserAdminForm.php 77
  14. ldap_user/src/Form/LdapUserAdminForm.php 230
  15. ldap_user/src/Processor/OrphanProcessor.php 136

Remaining tasks

  1. Review the changes.

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024