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

Class "cweagans\Composer\PatchEvents" not found #2

Open
osopolar opened this issue Oct 9, 2024 · 3 comments · May be fixed by #3
Open

Class "cweagans\Composer\PatchEvents" not found #2

osopolar opened this issue Oct 9, 2024 · 3 comments · May be fixed by #3

Comments

@osopolar
Copy link

osopolar commented Oct 9, 2024

Checking out my current project which uses this plugin and running composer install I get:

  • Installing orakili/composer-drupal-info-file-patch-helper (1.0.1): Extracting archive
    Install of orakili/composer-drupal-info-file-patch-helper failed

In Plugin.php line 65:

[Error]
Class "cweagans\Composer\PatchEvents" not found

Exception trace:
at /app/vendor/orakili/composer-drupal-info-file-patch-helper/src/Plugin.php:65

This is the same issue as in #1 . The solution there was:

... the problem was the order, I had to put pantheon-upstreams/upstream-configuration first

As stated in this old composer issue about install order:

the order in which you define your requirements has strictly no influence on the order in whcih packages are installed.

the rule to sort the packages for installations is that dependencies of a package are always installed before the package itself (except if you have a circular dependency in your packages of course as this would be impossible)

Therefore I assume the issue is with the missing dependency declaration. As composer-drupal-info-file-patch-helper/src/Plugin.php uses PatchEvents class shouldn't it declare a dependency on cweagans/composer-patches?

@osopolar osopolar linked a pull request Oct 9, 2024 that will close this issue
@osopolar
Copy link
Author

osopolar commented Oct 9, 2024

BTW: An alternative of using this plugin might be following instructions from https://chromatichq.com/insights/patching-info-files-composer/

@prudloff-insite
Copy link

prudloff-insite commented Jan 29, 2025

@orakili Is this plugin still maintained?

We have the same problem on one of our projects and it looks like it would be an easy fix.

Our workaround is to install like this:

composer install --no-plugins
composer install

@prudloff-insite
Copy link

prudloff-insite commented Feb 4, 2025

Turns out the workaround prevents installing packages in the correct folder when using composer/installers so we really need a proper fix.

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

Successfully merging a pull request may close this issue.

2 participants