Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 9 May 2023, almost 2 years ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects ā†’

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot ā†’ official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot ā†’ or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot ā†’ , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue ā†’ . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue ā†’ .

šŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡¦šŸ‡¹Austria maxilein

    Applying #12 and running upgrade status produces theses errors:

    CONTRIBUTED PROJECTS
    --------------------------------------------------------------------------------
    Serial 8.x-1.0-alpha2
    Scanned on Fri, 2023-01-27 - 10:47.

    2 errors found. 3 warnings found. Avoid some manual work by using drupal-rector
    for fixing issues automatically or Upgrade Rector to generate patches.

    modules/contrib/serial/src/Plugin/Field/FieldType/SerialItem.php:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ STATUS ā”‚ LINE ā”‚ MESSAGE ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check ā”‚ 111 ā”‚ 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. ā”‚
    ā”‚ ā”‚ ā”‚ ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

    modules/contrib/serial/src/SerialSQLStorage.php:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ STATUS ā”‚ LINE ā”‚ MESSAGE ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check ā”‚ 197 ā”‚ 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. ā”‚
    ā”‚ ā”‚ ā”‚ ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

    modules/contrib/serial/tests/src/Functional/SerialFieldTest.php:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ STATUS ā”‚ LINE ā”‚ MESSAGE ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Fix with ā”‚ 137 ā”‚ Call to deprecated method drupalPostForm() of class ā”‚
    ā”‚ rector ā”‚ ā”‚ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and ā”‚
    ā”‚ ā”‚ ā”‚ is removed from drupal:10.0.0. Use $this->submitForm() ā”‚
    ā”‚ ā”‚ ā”‚ instead. ā”‚
    ā”‚ ā”‚ ā”‚ ā”‚
    ā”‚ Fix with ā”‚ 163 ā”‚ Call to deprecated method drupalPostForm() of class ā”‚
    ā”‚ rector ā”‚ ā”‚ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and ā”‚
    ā”‚ ā”‚ ā”‚ is removed from drupal:10.0.0. Use $this->submitForm() ā”‚
    ā”‚ ā”‚ ā”‚ instead. ā”‚
    ā”‚ ā”‚ ā”‚ ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

    modules/contrib/serial/serial.info.yml:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ STATUS ā”‚ LINE ā”‚ MESSAGE ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check ā”‚ 0 ā”‚ Value of core_version_requirement: ^8 || ^9 is not ā”‚
    ā”‚ manually ā”‚ ā”‚ compatible with the next major version of Drupal core. See ā”‚
    ā”‚ ā”‚ ā”‚ https://drupal.org/node/3070687. ā”‚
    ā”‚ ā”‚ ā”‚ ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

  • Also tested #12, it works for me.

    I also made a patch from scratch based on 'update_status'. Patch attached, the main difference is that phpunit tests now also work.

    Fixed:

    FILE: modules/contrib/serial/tests/src/Functional/SerialFieldTest.php
    
    STATUS         LINE                           MESSAGE
    --------------------------------------------------------------------------------
    Check manually 16   Drupal\Tests\BrowserTestBase::$defaultTheme is required. See
                        https://www.drupal.org/node/3083055, which includes
                        recommendations on which theme to use.
    --------------------------------------------------------------------------------
    Check manually 137  Call to deprecated method drupalPostForm() of class
                        Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                        is removed from drupal:10.0.0. Use $this->submitForm()
                        instead.
    --------------------------------------------------------------------------------
    Check manually 163  Call to deprecated method drupalPostForm() of class
                        Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                        is removed from drupal:10.0.0. Use $this->submitForm()
                        instead.
    --------------------------------------------------------------------------------
    
    FILE: modules/contrib/serial/serial.info.yml
    
    STATUS         LINE                           MESSAGE
    --------------------------------------------------------------------------------
    Check manually 0    Value of core_version_requirement: ^8 || ^9 is not
                        compatible with the next major version of Drupal core. See
                        https://drupal.org/node/3070687.
    --------------------------------------------------------------------------------
    

    Still open as "deprecated in 10.x":

      2x: The theme 'classy' is deprecated. See https://drupal.org/node/3223395#s-classy
        1x in SerialFieldTest::testSerialField from Drupal\Tests\serial\Functional
        1x in SerialFieldTest::testSerialEntityCreation from Drupal\Tests\serial\Functional
    

    I used 'classy' as theme for now to make the tests work again. In https://drupal.org/node/3070687 they suggest to use "stark" as theme but then some more changes are needed in the unit tests.

  • šŸ‡®šŸ‡³India kuhikar

    Thanks @sboden, @reenaraghavan, @maxilein :

    I have verified the #14, #12: it is working. I have added patch to resolve the remaining test case warning. Kindly review patch: serial-3298036-15.patch

    It is working for the Drupal 10 and Drupal 9.

  • Status changed to RTBC about 2 years ago
  • šŸ‡®šŸ‡³India kamleshbp

    Patch #15 is getting applied successfully and it is working for me. So moving it to RTBC.

  • šŸ‡ØšŸ‡“Colombia metallized

    I have not tested the patch but according to the Upgrade Status module, this module is not yet compatible with Drupal 10.

    Maybe we need first tag this as "Review" to trigger the "Project Update Bot"

  • Status changed to Needs review almost 2 years ago
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update almost 2 years ago
    Composer require failure
  • šŸ‡ØšŸ‡“Colombia metallized

    Is this should be tagged as `8.x-1.x-dev` or `8.x-1.x-alpha-2`?

  • @metallized opened merge request.
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update almost 2 years ago
    Composer require failure
  • Status changed to RTBC almost 2 years ago
  • šŸ‡ØšŸ‡“Colombia metallized

    Created MR so that it can be merge directly.
    Moving to RTBC.

  • Status changed to Fixed almost 2 years ago
  • šŸ‡ØšŸ‡“Colombia metallized

    New release published.

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

Production build 0.71.5 2024