Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symfony/http-foundation incompatibility with Drupal 10 #259

Open
davejenx opened this issue Nov 16, 2023 · 3 comments
Open

symfony/http-foundation incompatibility with Drupal 10 #259

davejenx opened this issue Nov 16, 2023 · 3 comments

Comments

@davejenx
Copy link

Trying nz.co.fuzion.omnipaymultiprocessor version 3.21 with Civi 5.65.2 on Drupal 10.1.6, getting the following error:

PHP Fatal error: Declaration of Symfony\Component\HttpFoundation\ResponseHeaderBag::all() must be compatible with Symfony\Component\HttpFoundation\HeaderBag::all(?string $key = null): array in .../nz.co.fuzion.omnipaymultiprocessor-3.21/vendor/symfony/http-foundation/ResponseHeaderBag.php on line 93

The extension's composer.lock has symfony/http-foundation version "4.4.x-dev", which comes as a dependency of:

  • omnipay/common - require "symfony/http-foundation": "^2.1|^3|^4|^5|^6"
  • omnipay/tests v3.1.1 - require-dev "symfony/http-foundation": "^3|^4"

The site's composer.lock has symfony/http-foundation version "v6.3.7", which comes as a dependency of, among others:

  • drupal/core - "symfony/http-foundation": "^6.3"

So omnipay/tests seems to be the thing holding it back. The extension's composer.lock has various packages requiring omnipay/tests under require-dev (but none as non-dev require), including omnipay/common which specifies "omnipay/tests": "^4.1", which confusingly doesn't fit with the installed version, omnipay/tests v3.1.1 .

Has anyone got this working on D10?

@shaesen
Copy link

shaesen commented Nov 20, 2023

Same issue here:
Fatal error: Declaration of Symfony\Component\HttpFoundation\ResponseHeaderBag::all() must be compatible with Symfony\Component\HttpFoundation\HeaderBag::all(?string $key = null): array in .../sites/default/files/civicrm/ext/nz.co.fuzion.omnipaymultiprocessor/vendor/symfony/http-foundation/ResponseHeaderBag.php on line 93
"omnipay/common", require "symfony/http-foundation": "^2.1|^3|^4|^5|^6"
"omnipay/common": "^3", require-dev "symfony/http-foundation": "^3|^4"

What is going on ?

@hansrossel
Copy link

Related, but on civi 5.69.5 and drupal 9.5.11

Declaration of Symfony\Component\HttpFoundation\JsonResponse::create($data = null, int $status = 200, array $headers = []) must be compatible with Symfony\Component\HttpFoundation\Response::create($content = '', $status = 200, $headers = []) in nz.co.fuzion.omnipaymultiprocessor/vendor/symfony/http-foundation/JsonResponse.php on line 73

@stesi561
Copy link

Hi team I have solved a similar issue
AttributeBag::getName() must be compatible with Symfony\Component\HttpFoundation\Session\SessionBagInterface::getName()

Our solution was to identify which symfony library caused the issue from the above error message we can see this is symfony/http-foundation

Repeating steps here in case helpful for others.

I used

find $SITEROOT -name 'SessionBagInterface.php';
to identify that the clash was between the root vendor and vendor in this extension

composer why symfony/http-foundation
gives us which versions of this component might be acceptable in each location and we can find a common version and use composer (or edit composer.json) to set the version we want then use composer to upgrade to the correct version.

i.e. composer upgrade --dry-run -w and composer upgrade -w if that succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants