Drupal 10 compatibility

Created on 22 February 2023, over 1 year ago
Updated 19 September 2023, about 1 year ago

Problem/Motivation

I'm curious about the plan for Drupal 10 compatibility for this module.
We have a few sites that use it and are about to be upgraded to Drupal 10, but I have issues updating/installing the module on the updated codebase even with `mglaman/composer-drupal-lenient` package.
I'm suspecting it's due to other dependencies like php-http/guzzle6-adapter and guzzlehttp/guzzle, and I don't know exactly how to resolve this.
Any help would be appreciated.

What I'm currently getting:

Problem 1
    - drupal/sparkpost 2.x-dev is an alias of drupal/sparkpost dev-2.x and thus requires it to be installed too.
    - drupal/sparkpost[dev-2.x, 2.2.0] require php-http/guzzle6-adapter ^1.1 -> satisfiable by php-http/guzzle6-adapter[v1.1.0, v1.1.1].
    - php-http/guzzle6-adapter[v1.1.0, ..., v1.1.1] require guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.5.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires drupal/sparkpost ^2.2 -> satisfiable by drupal/sparkpost[2.2.0, 2.x-dev (alias of dev-2.x)].

I'm providing an initial patch for D10 compatibility that updates the core_version_requirement in the info file. It also broadens the php-http/guzzle6-adapter inspired by this issue which might help with the new compatibility with D10.

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇸🇮Slovenia josip.rajkovic

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

Comments & Activities

  • Issue created by @josip.rajkovic
  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • @mattjones86 opened merge request.
  • 🇬🇧United Kingdom mattjones86 🇬🇧 GMT+0

    Put your patch into a merge request for easier testing with composer.

  • Status changed to Needs review over 1 year ago
  • 🇬🇧United Kingdom mattjones86 🇬🇧 GMT+0
  • 🇬🇧United Kingdom mattjones86 🇬🇧 GMT+0

    This will need more work because the 10.x core requires guzzlehttp/guzzle:^7.0.

    This module requires php-http/guzzle6-adapter, which has a guzzlehttp/guzzle:^6.0 constraint, even on the latest version.

      Problem 1
        - Root composer.json requires drupal/sparkpost dev-3343783-drupal-10-compatibility -> satisfiable by drupal/sparkpost[dev-3343783-drupal-10-compatibility].
        - Conclusion: don't install guzzlehttp/guzzle 7.4.0 (conflict analysis result)
        - Conclusion: don't install drupal/core 10.0.0-alpha3 (conflict analysis result)
        - Conclusion: don't install drupal/core 10.0.0-alpha4 (conflict analysis result)
        - drupal/core 10.0.0-alpha5 requires guzzlehttp/guzzle ^7.4.3 -> satisfiable by guzzlehttp/guzzle[7.4.3, ..., 7.7.x-dev].
        - Conclusion: don't install guzzlehttp/guzzle 7.4.4 (conflict analysis result)
        - drupal/core[10.0.0-beta1, ..., 10.1.x-dev] require guzzlehttp/guzzle ^7.5 -> satisfiable by guzzlehttp/guzzle[7.5.0, ..., 7.7.x-dev].
        - drupal/core[10.0.0-alpha6, ..., 10.0.0-alpha7] require guzzlehttp/guzzle ^7.4.5 -> satisfiable by guzzlehttp/guzzle[7.4.5, ..., 7.7.x-dev].
        - Conclusion: don't install guzzlehttp/guzzle 7.5.0 (conflict analysis result)
        - Conclusion: don't install guzzlehttp/guzzle 7.6.1 (conflict analysis result)
        - Conclusion: don't install drupal/core 10.1.0 (conflict analysis result)
        - Conclusion: don't install drupal/core 10.1.1 (conflict analysis result)
        - Conclusion: don't install guzzlehttp/guzzle 7.7.0 (conflict analysis result)
        - drupal/core[10.0.0-alpha1, ..., 10.0.0-alpha2] require guzzlehttp/guzzle ^7.3.0 -> satisfiable by guzzlehttp/guzzle[7.3.0, ..., 7.7.x-dev].
        - Conclusion: don't install guzzlehttp/guzzle 7.3.0 (conflict analysis result)
        - Root composer.json requires drupal/core ^10.0 -> satisfiable by drupal/core[10.0.0-alpha1, ..., 10.1.x-dev].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • 🇳🇴Norway eiriksm Norway

    Thanks for starting this!

    It looks to me as if we're going to have to do a new major version for this, and only support d10 in it.

    Updated the branch to also make sure the sub module sparkpost requeue is compatible

  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Assigned to omarlopesino
  • Status changed to Needs work about 1 year ago
  • 🇪🇸Spain omarlopesino

    Tried to use it in a D9 site and got the following error: Message Error: Class "Http\Adapter\Guzzle6\Client" not found.
    I've fixed it in this commit and now it works and the emails are sent.

    I have to mention the problem that is hard to install the module with this changes as it uses guzzle 7, and rearranging all the libraries takes some time. There are a lot of drupal dependencies, specially dev ones (drupal core dev 9.5.10, drupal extension 4, lower versions of drush 11...) that uses guzzle 6.

    I think we should make the module compatible with guzzle 6 and 7 so installing a version compatible Drupal 10 is easier and do not require installing guzzle 7 in a Drupal 9 site. Working on it.

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇪🇸Spain omarlopesino

    I would like to propose a solution for this , let me know what do you think:

    • In the latest commit, the code that uses PHP guzzle adapter is changed so it supports either guzzle 6 or guzzle 7.
    • In the Drupal 9 projects, to be able to install the Drupal 10 compatible version, these steps can be followed:
      1. Explicitly require php-http/guzzle6-adapter
      2. Add php-http/guzzle7-adapter in the replace section of the composer.json:
            "replace": {
                "php-http/guzzle7-adapter": "*"
            },
        
      3. After this , you can require the sparkpost version compatible with Drupal 10 into a Drupal 9 site without having any conflict, and it will work.
      4. During the upgrade from core 9 to 10, php-http/guzzle6-adapter should be removed , then upgrade the core so guzzle 7 is installed, and after that remove php-http/guzzle7-adapter from replace so it is added to the project and sparkpost uses finally guzzle7 adapter.
  • 🇺🇸United States CLKeenan

    I'm in the final stages of upgrading from D9 to 10. Curious if the above solution has been committed / will be committed?

  • 🇳🇴Norway eiriksm Norway

    I am leaning towards making a new branch for d10.

    The solution mentioned in #12 probably works. but it's kind of user unfriendly :) I mean, thanks so much for taking the time and writing it down, but the dependencies of this project really does make it messy to upgrade. Which is why I think upgrading in a new branch with d10 compatibility only, feels easier to both implement, but probably also to understand as a user

    Personally I have been successfully upgrading with a patch from the MR here, so you could start with that if you need it. In the meantime, I will just start a new branch and get this MR targeted towards it

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • 🇳🇴Norway eiriksm Norway

    I will just merge this now, since we can break BC in 3.x, the new branch. Please test, people watching this issue!

    Thanks everyone for your contribution!

  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States CLKeenan

    Thank you!

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

Production build 0.71.5 2024