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

Composer version 2.2.5 might break Contao installations #4017

Closed
ben-eSM opened this issue Jan 28, 2022 · 6 comments · Fixed by #4020
Closed

Composer version 2.2.5 might break Contao installations #4017

ben-eSM opened this issue Jan 28, 2022 · 6 comments · Fixed by #4020
Assignees
Labels
Milestone

Comments

@ben-eSM
Copy link

ben-eSM commented Jan 28, 2022

Affected version(s)

all

Description

Due to the new handling regarding the composer/package-versions-deprecated plugin introduced in Composer version 2.2.5 (see Pull Request #10458), there's a chance that the vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php file contains an empty VERSIONS constant. That could lead to errors like There is no "contao-components/*" asset package.

I just had two installations where composer was updated from 2.1.x to 2.2.5 which lead to this issue.

@ausi
Copy link
Member

ausi commented Jan 28, 2022

Accessing this constant does not seem to be an intended use case, see https://github.com/composer/package-versions-deprecated/blob/b4f54f74ef3453349c24a845d22392cd31e65f1d/src/PackageVersions/Installer.php#L66 so we probably have to change this.

@ausi ausi added this to the 4.9 milestone Jan 28, 2022
@ausi
Copy link
Member

ausi commented Jan 28, 2022

We should probably add a check like method_exists(InstalledVersions::class, 'getInstalledPackagesByType') and use the implementation from Contao 4.13 in this case:

foreach (InstalledVersions::getInstalledPackagesByType('contao-component') as $name) {
and only use the current code as a fallback if the method does not exist.

@ausi
Copy link
Member

ausi commented Jan 28, 2022

For everyone else experiencing this issue: Downgrading to Composer 2.2.4 (e.g. via composer self-update 2.2.4) can be a way to workaround this issue for now.

@ben-eSM
Copy link
Author

ben-eSM commented Jan 28, 2022

For everyone else experiencing this issue: Downgrading to Composer 2.2.4 (e.g. via composer self-update --rollback) can be a way to workaround this issue for now.

I can confirm that. composer self-update 2.2.4 does the trick.

@ausi ausi self-assigned this Jan 28, 2022
@ausi ausi linked a pull request Jan 28, 2022 that will close this issue
@ausi
Copy link
Member

ausi commented Jan 28, 2022

Closed in favor of #4020

@ausi ausi closed this as completed Jan 28, 2022
@ausi
Copy link
Member

ausi commented Jan 28, 2022

It would be great if someone could verify that the changes from #4020 work in a setup that is currently broken.

leofeyer added a commit that referenced this issue Jan 31, 2022
Description
-----------

Fixes #4017

For everyone experiencing the issue `There is no "contao-components/*" asset package`:  
Downgrading to Composer 2.2.4 (e.g. via `composer self-update 2.2.4`) can be a way to workaround this issue for now.

Commits
-------

24874fd Fix compatibility with Composer 2.2.5
0ae7ce0 Allowing the package versions plugin is no longer needed
dba7dcc Fix prefer lowest
ded3ad3 CS

Co-authored-by: Leo Feyer <github@contao.org>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants