contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
83 stars 33 forks source link

Do not update composer.json scripts to contao-setup #744

Closed fritzmg closed 1 year ago

fritzmg commented 1 year ago

In the community it occurs very frequently that users get stuck when updating from Contao 4.4 or 4.5 etc. to Contao 4.9, because the Contao Manager automatically replaces

    "scripts": {
        "post-install-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ],
        "post-update-cmd": [
            "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
        ]
    }

with

    "scripts": {
        "post-install-cmd": [
            "@php vendor/bin/contao-setup"
        ],
        "post-update-cmd": [
            "@php vendor/bin/contao-setup"
        ]
    }

which will not work in Contao 4.9. I think the Contao Manager should not change this at all and leave it up to the user to change it.

aschempp commented 1 year ago

It should only be changed when upgrading to Contao 5.0 🤔 https://github.com/contao/contao-manager/blob/bd4d585cbb585295dfbc42836a955449708f7fb8/api/Task/Packages/UpdateTask.php#L225-L238

fritzmg commented 1 year ago

Hm, not sure then. It happens quite frequently though that people get stuck with vendor/bin/contao-setup with their <4.10 Contao instances (haven't tried to reproduce this myself).

aschempp commented 1 year ago

and I doubt they all downgraded their Contao 5?

fritzmg commented 1 year ago

Yes, they all either updated from 4.* to 4.9 or 4.9 to 4.13 (but that update failed and thus they were still at 4.9 - but with vendor/bin/contao-setup in their scripts section).

fritzmg commented 1 year ago

Recent cases: