Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 8 August 2023, over 1 year 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 β†’

Periodically patches will be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted simply close this issue (any status besides Active, Needs review or Needs work) or remove the "ProjectUpdateBotD10" tag from the issue.

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 or Needs work) 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.

  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 don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD10" tag from the issue.

    You can use Drupal Rector yourself to make these patches.

    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 or Needs work) 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 may be useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the patch in the comment by Project Update Bot β†’ .
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.

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 Infrastructure project issue queue β†’ using the component β€œBot: Drupal Rector”.

πŸ“Œ 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.

  • πŸ‡ΊπŸ‡ΈUnited States Jaesin

    @kreatIL, I understand. Let's see what direction the maintainers want to take it.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    I have applied the patch from MR6 and for the most part, the upgrade status module is happy. It is dubious about the appearance of the file_create_url function, but the way @jrglasgow is using it seem merely to be for backwards-compatibility, not the de facto method of file upload. I'm inclined to say this is probably ready to go.

  • πŸ‡ΊπŸ‡ΈUnited States jrglasgow Idaho

    @loopy1492,
    Actually the file_create_url() work you are talking about was done by Jaesin in this patch and it could be removed if we wanted to limit the compatibility to ^9.3 || ^ 10, since 8.x and 9.3.x are no longer supported versions of Drupal core I have no problem with that.

  • Status changed to Needs work almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States Greg Boggs Portland Oregon

    setting needs work to remove the file_url code mentioned

  • First commit to issue fork.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States rpayanm

    I added the #8's suggestion. Please review.

  • πŸ‡ΊπŸ‡ΈUnited States Greg Boggs Portland Oregon

    Looks good. Can we remove Drupal core from the composer.json file please? It's already listed in the .info file which is all Drupal cares about. Once Drupal 9.3 is end of life, we will need to edit the composer.json file to remove core to prevent security warnings and no one should be installing Drupal core by requiring the theme first, so we shouldn't encourage composer to install Drupal core that way.

  • πŸ‡ΊπŸ‡ΈUnited States rpayanm

    @Greg Boggs I was looking at composer.json and I saw the seven dependency. What about it? It was removed from Drupal 10.

  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    Looks good.

    As far as the composer change suggested in #31, I think its fine the way it is. Its not a security problem to have an older version of the dependency in the list and listing your dependencies is how composer.json is suppose to work. I think the packaging script would generally take care of it but being explicit shouldn't be a bad thing.

    re #32 The seven dependency is handled by contrib in 10 which is what the composer.json file is saying. https://drupal.org/project/seven

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States smeechos

    Adjusted a slight typo in core version requirement.

    Was: core_version_requirement: ^9.3 || ^ 10

    Now: core_version_requirement: ^9.3 || ^10

  • πŸ‡ΊπŸ‡ΈUnited States Greg Boggs Portland Oregon

    The explicit requirement for an old version of Drupal is a security vulnerability because that allows Drupal 9.0 to be installed which is end of life software. If you're going to specify drupal versions in composer.json, then you must keep that updated with each version of Drupal 9 that expires, so you're going to be committing to the file once per minor release. If you leave that out, then you can not update the composer file every couple of months.

    And no one should ever install Drupal core by doing composer require drupal/adminimal and we should even make sure that doesn't work incase someone makes that mistake.

    https://git.drupalcode.org/project/adminimal_theme/-/merge_requests/6/di...

  • πŸ‡ΊπŸ‡ΈUnited States smeechos

    Removing core requirement from composer.json, per #36.

  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    The core requirement isn't _actually_ a security risk for 2 reasons.

    1. Drupal 9 is explicitly supported for a while still
    2. After it is no longer supported, it may still be supported by LTS vendors like 8 currently is for some people.
    3. The || means there isn't an explicit _requirement, only noting it works with it.

    That said, the change in #37 doesn't really matter because Drupal.org packaging will inject the core_version_requirements from the info into the composer file so its effectively the same now as it was before the change.

    Still looks good to go.

  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    Whatever the case, I'm glad for projects that are setting the core version requirements to some version of 9 in addition to 10. In preparation for the d10 upgrade, we are running through a d10 readiness story for ALL of our sites before actually making the move to d10. We cannot actually upgrade a few modules yet because the maintainers have decided to remove d9 from the picture entirely which is infuriating.

  • πŸ‡ΊπŸ‡¦Ukraine Extatic

    Hey Guys.
    Proposed automated patch didn't completely covered all the theme compatibility. So I created my own one and would like to share it with you.
    Good luck!

  • First commit to issue fork.
  • πŸ‡§πŸ‡ͺBelgium jelle_s Antwerp, Belgium

    FWIW: We're using the latest MR in a Drupal 9.5.9 website with the Seven theme from contrib. Works as expected.

  • heddn Nicaragua

    Patch in #40 isn't any different then the MR. Can we get it commit and a new D10 compat release tagged please? RTBC++

    :pray:

  • πŸ‡ΊπŸ‡¦Ukraine dinazaur

    Patch and MR are different actually.

    MR includes changes for composer.json

      "require": {
          "drupal/seven": "~1.0"
      }
    

    Instead, the patch contains some unrequired changes.

    +1 RTBC for MR anyway.

  • πŸ‡ΊπŸ‡¦Ukraine rznasa

    Can someone merge the changes and make a version for Drupal 10?

  • Status changed to Fixed over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom rjjakes

    Merged to 1.x-dev

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

Production build 0.71.5 2024