Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If core devs are using a version of composer earlier than one that has getVersion() in it, they hit this error:
PHP Fatal error: Uncaught Error: Call to undefined method Composer\Composer::getVersion() in /Users/mike/Development/Drupal/core/lib/Drupal/Core/Composer/Composer.php:104
Looks like we can fall back on \Composer\Composer::VERSION;
https://github.com/composer/composer/commit/427116749558f99e4c04ffa3fe35...
Comment | File | Size | Author |
---|---|---|---|
#4 | 3073012-4.patch | 796 bytes | greg.1.anderson |
#2 | 3073012-2.patch | 711 bytes | Mixologic |
Comments
Comment #2
MixologicHeres a patch that goes back far enough to stop that issue.
Comment #3
MixologicComment #4
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedFuture-proofing: since Composer::getVersion() has been added, it is possible that future versions of Composer may remove Composer::VERSION. This can't happen until at least 2.0, in theory, but still worth checking IMO, since we have nothing else constraining / checking our Composer version support.
Comment #5
mikelutzRTBC from me.
I rolled back to composer 1.6.5 and checked out drupal 8.7.x and did a composer install to reset everything.
I then checked out 8.8.x. Without the patch running composer install I get
I applied the patch and with composer install I get:
I then manually grabbed composer 1.8.6 and composer installed with that and got:
I then ran composer self-update to get composer 1.9.0 and was able to successfully run composer install.
Comment #6
larowlanComment #7
larowlanThanks for the quick turnaround
Committed 7db7b5a and pushed to 8.8.x. Thanks!