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.

CommentFileSizeAuthor
initial-d10-compatibility.patch747 bytesjosip.rajkovic

Issue fork sparkpost-3343783

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

josip.rajkovic created an issue. See original summary.

josip.rajkovic’s picture

Issue summary: View changes

mattjones86 made their first commit to this issue’s fork.

mattjones86’s picture

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

mattjones86’s picture

Status: Active » Needs review
mattjones86’s picture

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.

eiriksm made their first commit to this issue’s fork.

eiriksm’s picture

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

omarlopesino made their first commit to this issue’s fork.

omarlopesino’s picture

Assigned: Unassigned » omarlopesino
Status: Needs review » Needs work

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 with Drupal 10 is easier and do not require installing guzzle 7 in a Drupal 9 site. Working on it.

omarlopesino’s picture

Assigned: omarlopesino » Unassigned
Status: Needs work » Needs review

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.

To let people know what steps must be done, it can be documented as an upgrade path.

clkeenan’s picture

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

eiriksm’s picture

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

eiriksm’s picture

Version: 8.x-2.2 » 3.x-dev
eiriksm’s picture

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!

  • eiriksm committed 6cbc7c13 on 3.x authored by mattjones86
    Issue #3343783 by mattjones86, eiriksm, omarlopesino, josip.rajkovic:...
eiriksm’s picture

Status: Needs review » Fixed
clkeenan’s picture

Thank you!

Status: Fixed » Closed (fixed)

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