Automated Drupal 10 compatibility fixes

Created on 15 June 2022, over 2 years ago
Updated 14 March 2024, 8 months 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

2.1

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.

  • πŸ‡§πŸ‡ͺBelgium lisotton Brussels

    Hi @jcontreras, I see that the new version (2.1.0) will be only compatible with Drupal 10 and the version 2.0.2, you marked as not compatible with Drupal 10. Actually you made a commit before releasing the version removing the compatibility at commit 5e8ebf5e.

    I'm working in a big site, migrating it to Drupal 10 and I would like to make all contrib modules compatible with Drupal 10, before upgrading the core itself.

    Do you have any plan to release 2.0.3 with compatibility with both Drupal 9 and Drupal 10?

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

    @lisotton - there are some major changes with php8 and Symphony on Drupal 10 and there are a lot of sites not ready to jump into Drupal 10 so I am making a distinction here to be able to support both D9 and D10 separately. Makes it easier to support older versions.

    For Drupal 8 and 9 use version ~2.0.x
    For Drupal 10 use version ~2.1.x

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

    In other words, when you are ready to move forward with Drupal 10, update this module to 2.10-beta as well.

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

    I'm having trouble upgrading to D10 because of this module. The site is currently on 2.0.2. Composer adds a drupal/core requirement to the lock file for contrib modules. The version of drupal/core that gets specified is taken from core_version_requirement in the info.yml file. So, because drupal/core 8 or 9 is specified in the lock file for this module, Composer says, "nope, can't upgrade you to D10". Even specifying drupal/block_exclude_pages:2.1.0-beta2 in the `composer require` command for the upgrade, it fails because of this drupal/core 8 || 9 requirement. And I can't upgrade this module to the D10 version on D9. Suggestions for unblocking this circular dependency?

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

    @micnap - did you try specifying "~2.1.0" for this module in the composer.json file? not the lock file.
    (right before you run the command to upgrade to D10)
    --- 2.1.0 is D10 specific. You can't install it in D9. and should only be installed in D10 ---

  • πŸ‡§πŸ‡ͺBelgium lisotton Brussels

    I still don't understand why cannot have a version that is both compatible with Drupal 9 and 10 like most of other modules.

    If we would have this, we could upgrade this module first (like I'm doing with other contrib modules) and then in a latest stage, upgrade Drupal 10 (as all contrib modules are already compatible).

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

    Update to Drupal 10.1 - On this new version drupal is limiting the syntax of the URLs that can get added to the page's settings. As a temp fix, I have created a patch that can be used until I create a rewrite of the method via this module (in the works).

    Use this patch for now.
    https://www.drupal.org/project/drupal/issues/3375092#comment-15153306 πŸ’¬ Drupal 10.1 + Rejecting paths not conforming to standard URL's set by Drupal Postponed: needs info

    Because of this there are significant changes to the module and may move towards an OOP strategy and add a lot more to make this work. The reason why it can not exist on both old D9 vs D10. both will work very differently and affect the site in different ways.

    For that reason, if you are in the middle of upgrading to D10 use this on your composer:
    "drupal/block_exclude_pages": "~2.0 || ^2.1@beta"

  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jcontreras

    ---

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

    Making some 9x>10 plans and I need to try to clarify the process a bit. Or confirm what I'm thinking.

    Is it something like disable 2.0, upgrade the site to D10, then composer require the 2.1?
    Or... since the "!... " exclusions are stored in each block config, just uninstall the 2.0, then after upgrading the site, reinstall 2.1? I'm thinking that's the way to go.

    This, then:
    * Disable, then composer remove the 2.0 version
    * Complete site upgrade to D10
    * Composer require the 2.1 beta version.
    Done.

  • Status changed to Fixed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jcontreras
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024