Remaining Drupal 10 deprecation issues

Created on 22 September 2023, over 1 year ago
Updated 29 September 2023, over 1 year ago

Problem/Motivation

When updating a site to Drupal 10, there was a deprecation error so I've run upgrade status against the latest dev version.

CUSTOM PROJECTS
--------------------------------------------------------------------------------
Quant
Scanned on Fri, 09/22/2023 - 16:59.

2 warnings found.

web/modules/custom/quantcdn/modules/quant_search/src/Form/QuantSearchPageForm.ph
p:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                           MESSAGE                            │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check    │ 537  │ Relying on entity queries to check access by default is      │
│ manually │      │ 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/custom/quantcdn/src/EventSubscriber/CollectionSubscriber.php:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                           MESSAGE                            │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check    │ 121  │ Relying on entity queries to check access by default is      │
│ manually │      │ 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

On Drupal 10, install and configure quant and then try running drush quant:seed-queue:

$ drush quant:seed-queue
Preparing seed...

In Query.php line 141:
                                                                                                                                      
  Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface:  
  :accessCheck().                                                                                                                     

Proposed resolution

Add access checks to remaining queries.

Remaining tasks

  • Update code
  • Review and test
  • Commit :)

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States Kristen Pol Santa Cruz, CA, USA

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

Comments & Activities

Production build 0.71.5 2024