Problem/Motivation

Drupal 9 has deprecated a few things that will be removed in Drupal 10. Let's fix them:

  • drupal_get_installed_schema_version()
  • Entity queries with no ->accessCheck() call
  • ModuleHandler::getImplementations()
  • WebDriverTestBase::drupalGetHeader()
  • TestBase::setUp() without :void

Steps to reproduce

Run tests on Drupal 9.4.

Proposed resolution

Fix runtime and test time deprecations where possible. Deprecations are fixed in a way to maintain compatibility with older versions of Drupal 9.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review

ptmkenny’s picture

@alexpott Any chance this could get committed soon? I'd like to try to work on getting a d10 version up and running, and getting this committed would be a big help.

kopeboy’s picture

+1

ptmkenny’s picture

Actually, Upgrade Status module did not report many additional issues on this branch:

CONTRIBUTED PROJECTS
--------------------------------------------------------------------------------
Field Encrypt
Scanned on Wed, 01/11/2023 - 15:09.

5 warnings found.

web/modules/contrib/field_encrypt/field_encrypt.install:
┌────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │                           MESSAGE                            │
├────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix    │ 35   │ Call to deprecated function                                  │
│ later  │      │ drupal_get_installed_schema_version(). Deprecated in         │
│        │      │ drupal:9.3.0 and is removed from drupal:10.0.0. Use          │
│        │      │ Drupal\Core\Update\UpdateHookRegistry::getInstalledVersion() │
│        │      │ or                                                           │
│        │      │ \Drupal\Core\Update\UpdateHookRegistry::getAllInstalledVersi │
│        │      │ ons() instead.                                               │
│        │      │                                                              │
└────────┴──────┴──────────────────────────────────────────────────────────────┘

web/modules/contrib/field_encrypt/src/ProcessEntities.php:
┌────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │                           MESSAGE                            │
├────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix    │ 70   │ Call to deprecated method getImplementations() of class      │
│ later  │      │ Drupal\Core\Extension\ModuleHandlerInterface. Deprecated in  │
│        │      │ drupal:9.4.0 and is removed from drupal:10.0.0. Instead you  │
│        │      │ should use ModuleHandlerInterface::invokeAllWith() for hook  │
│        │      │ invocations or you should use                                │
│        │      │ ModuleHandlerInterface::hasImplementations() to determine if │
│        │      │ hooks implementations exist.                                 │
│        │      │                                                              │
└────────┴──────┴──────────────────────────────────────────────────────────────┘

web/modules/contrib/field_encrypt/tests/src/Functional/FieldEncryptUpdatePathTes
t.php:
┌────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │                           MESSAGE                            │
├────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix    │ 29   │ Call to deprecated function                                  │
│ later  │      │ drupal_set_installed_schema_version(). Deprecated in         │
│        │      │ drupal:9.3.0 and is removed from drupal:10.0.0. Use          │
│        │      │ Drupal\Core\Update\UpdateHookRegistry::setInstalledVersion() │
│        │      │ instead.                                                     │
│        │      │                                                              │
└────────┴──────┴──────────────────────────────────────────────────────────────┘

web/modules/contrib/field_encrypt/field_encrypt.info.yml:
┌──────────┬──────┬────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                          MESSAGE                           │
├──────────┼──────┼────────────────────────────────────────────────────────────┤
│ Check    │ 0    │ Value of core_version_requirement: ^8.7.7 || ^9 is not     │
│ manually │      │ compatible with the next major version of Drupal core. See │
│          │      │ https://drupal.org/node/3070687.                           │
│          │      │                                                            │
└──────────┴──────┴────────────────────────────────────────────────────────────┘

web/modules/contrib/field_encrypt/composer.json:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                           MESSAGE                            │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check    │ 0    │ The drupal/core requirement is not compatible with the next  │
│ manually │      │ major version of Drupal. Either remove it or update it to be │
│          │      │ compatible. See                                              │
│          │      │ https://drupal.org/node/2514612#s-drupal-9-compatibility.    │
│          │      │                                                              │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘

So I fixed these deprecations and removed support for 8 and added support for 9 to this branch.

alexpott’s picture

Status: Needs review » Fixed

Let's get this done.

  • alexpott committed 9d5e6717 on 3.0.x
    Issue #3281488 by alexpott, ptmkenny: Prepare for Drupal 10
    
alexpott’s picture

Version: 3.0.x-dev » 3.1.x-dev

Status: Fixed » Closed (fixed)

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