Closed jrrdnx closed 1 year ago
Apparently the Craft update upgraded psr/http-message
to v2, but a dependency of phpoffice/phpspreadsheet
is still requiring v1:
Problem 1
- maennchen/zipstream-php[2.1.0, ..., 2.4.0] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.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.
- solspace/craft-freeform 4.1.6 requires phpoffice/phpspreadsheet 1.25.2 -> satisfiable by phpoffice/phpspreadsheet[1.25.2].
- phpoffice/phpspreadsheet 1.25.2 requires maennchen/zipstream-php ^2.1 -> satisfiable by maennchen/zipstream-php[2.1.0, ..., 2.4.0].
- Root composer.json requires solspace/craft-freeform 4.1.6 -> satisfiable by solspace/craft-freeform[4.1.6].
Hi @jrrdnx,
Sorry for the trouble you're experiencing.
I just tried this out myself (using composer update
and updating from Craft 4.4.16.1 => 4.5.1 while on Freeform 4.1.6), and it worked without issue.
Which version of PHP are you using and what does your entire main composer.json
file look like? 🙂
We're using PHP 8.2.7 on this project.
I was able to run composer update
with the -W
flag to downgrade psr/http-message
and get Freeform back to 4.1.6, so everything is back to working order now. But I am interested if I'm doing something different that would cause the discrepancy in behavior between you and I.
composer.json
:
{
"require": {
"craftcms/cms": "^4.4.0",
"craftcms/feed-me": "^5.2",
"craftcms/redactor": "^3.0.0",
"diginov/craft-sentry-logger": "^4.1.0",
"jrrdnx/craft-cloudflare-r2": "^1.0",
"mmikkel/cp-field-inspect": "^1.4.0",
"nystudio107/craft-retour": "^4.1.0",
"nystudio107/craft-seomatic": "^4.0.0",
"nystudio107/craft-vite": "^4.0.0",
"panlatent/schedule": "0.4.0.1",
"putyourlightson/craft-blitz-recommendations": "^2.1.0",
"putyourlightson/craft-sherlock": "^4.3.0",
"reusser/craft-sso": "dev-main",
"sebastianlenz/linkfield": "^2.1.0",
"solspace/craft-calendar": "^4.0",
"solspace/craft-freeform": "^4.0.0",
"spicyweb/craft-embedded-assets": "^3.1.0",
"spicyweb/craft-neo": "^3.7.0",
"utakka/redactor-anchors": "^1.4",
"verbb/expanded-singles": "^2.0.0",
"verbb/super-table": "^3.0.0",
"vlucas/phpdotenv": "^5.4.0"
},
"require-dev": {
"craftcms/generator": "^1.2",
"yiisoft/yii2-shell": "^2.0.3"
},
"autoload": {
"psr-4": {
"reusser\\": "modules/"
}
},
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true,
"php-http/discovery": true
},
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "8.2.1"
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
},
"repositories": [
{
"type": "path",
"url": "./plugins/*",
"options": {
"symlink": true
}
},
{
"type": "vcs",
"url": "..."
}
]
}
Also, in case it helps, running composer depends psr/http-message
outputs:
aws/aws-sdk-php 3.279.6 requires psr/http-message (^1.0 || ^2.0)
guzzlehttp/psr7 2.6.0 requires psr/http-message (^1.1 || ^2.0)
maennchen/zipstream-php 2.4.0 requires psr/http-message (^1.0)
php-http/client-common 2.7.0 requires psr/http-message (^1.0 || ^2.0)
php-http/httplug 2.4.0 requires psr/http-message (^1.0 || ^2.0)
php-http/message 1.16.0 requires psr/http-message (^1.1 || ^2.0)
php-http/message-factory 1.1.0 requires psr/http-message (^1.0 || ^2.0)
psr/http-client 1.0.2 requires psr/http-message (^1.0 || ^2.0)
psr/http-factory 1.0.2 requires psr/http-message (^1.0 || ^2.0)
So maennchen/zipstream-php
is the only package not requiring v1 or v2 of psr/http-message
. phpoffice/phpspreadsheet
is the only package requiring maennchen/zipstream-php
, with solspace/craft-freeform
the only package requiring phpoffice/phpspreadsheet
.
Thanks for the extra information, @jrrdnx.
Looking further into it, I can see that phpoffice/phpspreadsheet
requires:
"maennchen/zipstream-php": "^2.1 || ^3.0",
Then, maennchen/zipstream-php
v2 (PHP ^8.0) requires:
"psr/http-message": "^1.0",
While maennchen/zipstream-php
v3 (PHP ^8.1) suggests (not requires):
"psr/http-message": "^2.0",
I suppose that a fresh composer install
instead of running composer update
would have still had the maennchen/zipstream-php
v1 chosen, as all of the others offer both and would downgrade themselves.
That said, I see that we lock phpoffice/phpspreadsheet
in at v1.25.2, which doesn't yet include the "maennchen/zipstream-php": "^2.1 || ^3.0",
fix. I will check and see if we can update phpoffice/phpspreadsheet
to v1.29.0, as it seems to include it at that point:
https://github.com/PHPOffice/PhpSpreadsheet/commit/dbba80255562892845249f9e9e9c7c014eda547f
This should be resolved as of 4.1.7+. 🙂
Freeform 4 was downgraded from 4.1.6 to 4.0.8 when running
composer update
to update Craft 4.4.17 to 4.5.1. I haven't run into anything like this before, so I'm not exactly sure what the reason for this is. Runningcomposer update
again has no affect (Nothing to install, update or remove
) and Utilities -> Updates now lists all versions of Freeform from 4.0.9 to 4.1.6.Steps to reproduce
composer update
Expected behavior
No downgrading of Freeform
Craft & Plugin Info (please complete the following information):
Additional context
composer.json:
CLI output from running
composer update
: