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

Update throws php-error #205

Closed
barlambe opened this issue Feb 14, 2021 · 1 comment · Fixed by #206
Closed

Update throws php-error #205

barlambe opened this issue Feb 14, 2021 · 1 comment · Fixed by #206

Comments

@barlambe
Copy link

I Have 2 drupal sites using composer2.0 and in thee require I have wikimedia/composer-merge plugin.
Today, on uodating the sites with composer update, composer merge plugin causes following errors:

PHP Fatal error: Uncaught Error: Call to undefined method Wikimedia\Composer\Merge\ExtraPackage::getMergedRequirements() in phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code:287
Stack trace:
#0 phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code(254): Wikimedia\Composer\MergePlugin_composer_tmp0->mergeFile(Object(Composer\Package\RootPackage), 'modules/contrib...')
#1 phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code(215): Wikimedia\Composer\MergePlugin_composer_tmp0->mergeFiles(Array, false)
#2 [internal function]: Wikimedia\Composer\MergePlugin_composer_tmp0->onInstallUpdateOrDump(Object(Composer\Script\Event))
#3 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(173): call_user_func(Array, Object(Composer\Script\Event))
#4 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(101): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#5 phar:///usr/bi in phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code on line 287

Fatal error: Uncaught Error: Call to undefined method Wikimedia\Composer\Merge\ExtraPackage::getMergedRequirements() in phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code:287
Stack trace:
#0 phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code(254): Wikimedia\Composer\MergePlugin_composer_tmp0->mergeFile(Object(Composer\Package\RootPackage), 'modules/contrib...')
#1 phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code(215): Wikimedia\Composer\MergePlugin_composer_tmp0->mergeFiles(Array, false)
#2 [internal function]: Wikimedia\Composer\MergePlugin_composer_tmp0->onInstallUpdateOrDump(Object(Composer\Script\Event))
#3 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(173): call_user_func(Array, Object(Composer\Script\Event))
#4 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(101): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#5 phar:///usr/bi in phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(213) : eval()'d code on line 287

I must say that everything is still working fine but somewhere there must be something wrong.

gtz, bart

@mcaskill
Copy link
Contributor

We are aware of the issue in #189, see #189 (comment) for an explainer.

We do not have a solution as of yet.

tstarling added a commit to tstarling/composer-merge-plugin that referenced this issue Feb 23, 2021
Composer would try to load two versions of the same plugin, by reading
the main plugin file and rewriting the class name. But this doesn't work
if the plugin has multiple classes. It tries to run the new plugin class
with old helper classes.

So:

* Move all classes to Wikimedia\Composer\Merge\V2. This includes classes
  that were previously in the parent namespace.
* Clean up unused "use" statements.

Note that the namespace version number will have to be incremented every
time there is an internal interface change.

Closes wikimedia#205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants