Drupal core 8.4 was released yesterday so I thought today is a good time to start with a new commerce site.
Today, after installing commerce via composer I see that Drupal 8.3.7 has been installed and I note that the composer.json requires "drupal/core": "~8.3.0". This surprised me but I guessed that maybe commerce had not yet been updated from dev.
composer update drupal/commerce --with-dependencies does not appear to update core and returns the message Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Are we therefore expected to update Drupal core independently of commerce? - even though Drupal core is a dependency of commerce?
I thought that manually changing composer.json to require "drupal/core": "~8.4.0" and then running composer update drupal/commerce --with-dependencies might work, but this resulted in the output below
composer update drupal/commerce --with-dependencies
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package drupal/core (locked at 8.3.7, required as ~8.4.0) is satisfiable by drupal/core[8.3.7] but these conflict with your requirements
or minimum-stability.
Problem 2
- Conclusion: don't install drupal/core 8.4.0
- Conclusion: don't install drupal/core 8.4.0-rc2
- Conclusion: don't install drupal/core 8.4.0-rc1
- Conclusion: don't install drupal/core 8.4.0-beta1
- Conclusion: don't install drupal/core 8.4.0-alpha1
- Conclusion: remove symfony/class-loader v2.8.27
- Installation request for drupal/core ~8.4.0 -> satisfiable by drupal/core[8.4.0, 8.4.0-alpha1, 8.4.0-beta1, 8.4.0-rc1, 8.4.0-rc2, 8.4.x-dev].
- Conclusion: don't install symfony/class-loader v2.8.27
- drupal/core 8.4.x-dev requires symfony/class-loader ~3.2.8 -> satisfiable by symfony/class-loader[3.2.x-dev, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.
8, v3.2.9].
- Can only install one of: symfony/class-loader[3.2.x-dev, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.10, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.11, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.12, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.13, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.8, v2.8.27].
- Can only install one of: symfony/class-loader[v3.2.9, v2.8.27].
- Installation request for symfony/class-loader (locked at v2.8.27) -> satisfiable by symfony/class-loader[v2.8.27].
It's all a bit confusing. Can anybody put me right?
Comments
Comment #2
mrpauldriver commentedComment #3
mrpauldriver commentedComment #4
mrpauldriver commentedComment #5
hypertext200#2913970: Upgrading to 8.4.0: "drupal/core 8.4.0 requires symfony/console ~3.2.8" appeared to fix this issue.
Comment #6
uberhacker commented@MrPaulDriver: Did you try removing composer.lock and the entire vendor directory yet? That might be causing composer to puke. Try these steps:
Comment #7
bojanz commentedTeaching general Composer usage is a bit out of scope for our issue queue :)
"composer update drupal/commerce" updates drupal/commerce, core has nothing to do with it.
You need a general "composer update" to update core (after modifying the entry in composer.json to point to 8.4).
Comment #8
uberhacker commented@bojanz: This is definitely not out of scope. His problem is related to the inability to update Drupal commerce as a direct result of not being able to update Drupal core. In fact, the steps I presented will also upgrade drupal/commerce in the process.
Comment #9
mrpauldriver commentedThank you for the pointers @bojanz. Likewise @heshanlk and @uberhacker, I appreciate your support and kind advice.
As for teaching, I also appreciate also the big effort that has gone into the improved documentation and I try to teach myself by reading the docs and searching the issue queue before asking questions :)
But if the documented update instructions fail for some users, then perhaps there may be a bug or a possibility that the docs may be incomplete? Am I not contributing back in a small way by raising this?
I am quite sure that I won't be the only person asking this question or feeling similar pain. I will try all your suggestions and report back.
Comment #10
mrpauldriver commented@heshanlk Yes, the issue you point to seems to be root cause for not being able to update my new commerce site.
@uberhacker Your method appears to update everything, without error.
@bojanz So does yours :)
Like many others, this composer stuff is new to me, whether the usage is general or not.
Given that the requirement for a specific version of Drupal core belongs to the commerce composer.json file, should some mention of updating core not be made in the documentation at https://docs.drupalcommerce.org/commerce2/developer-guide/install-update... ?
Of the two methods discussed, which is best practice or most reliable?
Comment #11
uberhacker commented@MrPaulDriver: I could go on a long rant about what I think about composer but I'll spare you the pain. :) It would be nice if composer was smart enough to realize that updating Drupal core requires a composer.lock "override". Unfortunately, this is not the case. Because there are so many new dependencies with Drupal core 8.4.0 compared to earlier versions, the only reliable way (although, probably not an elegant "best practice") is to remove the vendor directory entirely along with composer.lock.
Comment #12
websiteworkspace commentedUpon having tried to update, the commerce composer.json seemed to have created a deadlock, a race condition between itself and core.
To get the update to work, the following changes worked:
Updated drush version requirement in project composer.json to:
"drush/drush": "~9.0"
as suggested above.
Removed the core requirement line from:
commerce.info.yml
-
Then, running:
composer update drupal/core
actually updated everything, including commerce core (on the dev branch).
--
Definitely going to try out 8.4.0 only on a test.{site} for a few days to see if anything breaks before updating any real dev project sites. Anything public can definitely wait a little bit to see what shakes out from this update.
Comment #13
bojanz commentedAgreed on docs. Opened https://github.com/drupalcommerce/commerce-docs/issues/150
Comment #14
websiteworkspace commented@uberhacker
You are correct.
I learned when updating from 8.2.x to 8.3.0 that the best way, your suggestion, is to just delete:
/core
/vender
composer.lock
and then run composer update and let it build a new clean set of site code.
Comment #15
mrpauldriver commentedUpdating core documentation found here which some may find useful
https://github.com/AcroMedia/commerce-demo
The demo is pretty cool too :-)
Comment #16
websiteworkspace commentedKeep in mind that the code available at:
(1)
https://github.com/AcroMedia/commerce-demo
Does not fully implement the commerce demo available at:
(2)
https://commercedemo.acromedia.com/
in part because the code on github does NOT include the needed MySQL database that contains all the content and configuration that exists in the running demo. In fact, that code on github only results in an empty Drupal site without anything configured.
---------------------------
I am part of a group working on an actual open source Commerce 2.x demo that will be available to others with code, configuration, and database, once completed, that others will hopefully be able to use to better understand Commerce 2.x and study an example Drupal Commerce 2.x deployment from the inside out.
---------------------------
Meanwhile, to successfully update to Drupal 8.4.0 with Commerce 2.x try using the following steps:
https://www.drupal.org/forum/support/upgrading-drupal/2017-10-06/update-...