AmpersandHQ / ampersand-magento2-upgrade-patch-helper

Helper script to aid upgrading magento 2 websites by detecting overrides. Now supports third party module detections
GNU Lesser General Public License v3.0
322 stars 39 forks source link

Support for php 8.2 #88

Closed leonhelmus closed 1 year ago

leonhelmus commented 1 year ago

Hey!

I was looking through the module and since mageto 2.4.6 got released i wanted to use this tool when upgrading to php 8.2. But it has a constraint which prevents me from updating ampersand. Could you add php 8.2 in composer.json? These are the requirements that need to be used:

"require": {
    "symfony/console": "^3.4|^4.0|^5.0",
    "php": "~7.2|~7.3|~7.4|~8.1|~8.2"
},
convenient commented 1 year ago

Hey @leonhelmus

So to be clear you don't need to be "requiring" this tool into any magento project, and the recommended way of using it is actually to git clone it.

You can make that change in the composer.json and you'll be able to composer install (provided it's valid that is)

I do not see 2.4.6 as having been released yet https://github.com/magento/magento2/releases/tag/2.4.6

Let me have a look at this as well, maybe its in pre release

leonhelmus commented 1 year ago

Yes at the moment its in prerelease and when analyzing its using the symfony/console package of Magento which is on version 5.

Which collides when changing the requirements it does work again

convenient commented 1 year ago

Did you need to update any other dependencies of this repo?

convenient commented 1 year ago

I imagine you maybe had to rm composer.lock ?

leonhelmus commented 1 year ago

Hey @convenient,

yes, your right i did that as well.

convenient commented 1 year ago

Was this your original error?

PHP Fatal error:  Uncaught Error: Call to undefined method Symfony\Component\Console\Helper\Helper::width() in /Users/lukerodgers/src/magento2-vanilla-versions/instances/enterprise/2.4.6/vendor/symfony/console/Helper/Table.php:835
leonhelmus commented 1 year ago

Yes, thats what i resolved by updating those dependencies.

convenient commented 1 year ago

Hey @leonhelmus

Can you please reset your git repo of any modifications and then

rm -rf vendor
git fetch
git checkout 2-4-6-support
composer install

And then try re-running the tool? I believe I have made sufficient amendments to allow it to run with php 7.4, 8.1, and 8.2.

This is kind of the ideal scenario, I myself have inherited projects some times that had old upgrades in flight that need to be completed prior to upgrading to the latest magento. In these scenarios, it's nice having the tool still functional with the recent checks.

The pull request https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/pull/89 cannot go green in travis until 2.4.6 is released properly, but will leave it there and visible until then.

leonhelmus commented 1 year ago

@convenient Sorry i did not have time yet too look my bad. Will try to look today or tomorrow.

convenient commented 1 year ago

No rush :) thanks @leonhelmus

justinconabree commented 1 year ago

Hi!

Confirming this works on my end with the 2.4.6 branch. Previously had the same issue.

Thanks!