I have installed Open Social version 3.6 with composer using:
composer create-project goalgorilla/social_template:dev-master [LOCAL DIRECTORY] --no-interaction
Now when I want to upgrade to version 4.x it will not work!
When I run:
composer update goalgorilla/open_social --with-dependencies
I get:
Dependency "composer/installers" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "cweagans/composer-patches" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal-composer/drupal-scaffold" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "doctrine/common" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "composer/installers" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "doctrine/collections" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
I used this command:
composer prohibits goalgorilla/open_social:4.1.0
and got:
goalgorilla/social_template dev-master requires goalgorilla/open_social (^3.5)
goalgorilla/open_social 4.1.0 requires drupal-composer/drupal-scaffold (^2.5.0)
goalgorilla/social_template dev-master requires drupal-composer/drupal-scaffold (2.4.0)
goalgorilla/open_social 4.1.0 requires drupal/addtoany (1.9)
goalgorilla/social_template dev-master does not require drupal/addtoany (but 1.10.0 is installed)
I tried to install "drupal-scaffold" with this:
composer require drupal-composer/drupal-scaffold:dev-master
But it didn't seem to help.
I give up. How do I update Open Social to version 4.x from version 3.6 using composer??
Help needed!
Comments
Comment #2
chlodewig commentedChange in: DIR/composer.json
"goalgorilla/open_social": "~3.0",
to
"goalgorilla/open_social": "~4.0",
Then run: composer update
Comment #3
Loketony commentedThanks for input. I changed in composer.json to:
"goalgorilla/open_social": ">=4.0"But got:
Comment #4
Loketony commentedThanks for input! I edited composer.json:
"goalgorilla/open_social": ">=4.0"But I got this:
I guess I have to install drupal-scaffold version 2.5.0 somehow? ...
Comment #5
Loketony commentedSolved!
I decided to try get rid of all the warning messages (see first post); so I deleted from composer.json:
and edited this line:
to
and now when I issue this command:
it finally worked as expected!
Thanks for leading me into the right direction! :-)
Comment #6
jaapjan commentedThat should indeed do the trick. In addition you could compare your composer.json file with this one: https://github.com/goalgorilla/social_template/blob/master/composer.json
Perhaps there is still some difference in the version constraint.
Comment #7
jaapjan commentedComment #8
Loketony commentedInteresting. My solution was actually a bit different. First I decided to get rid of all these warning-ignoring messages (see first post). So I removed these lines from composer.json:
Then I changed the versions of Open Social and PHP I want by editing the same file:
to:
Now my terminal purred like a cat and everything went smoothly:
:-) = Happy again!
Comment #9
jaapjan commentedGood to hear, thanks for sharing your solution!
Comment #10
mmjvb commentedDoubt very much "goalgorilla/open_social": "~4.0" would have been the solution. Prohibits reports a version conflict about drupal-scaffold between the template and open_social 4.1.0. That conflict is not resolved !
The current version of the template pins it to 2.5.0, which doesn't make sense to me. Also recommend against using ~4.0, suggest to standardize on ^4.0 or use ~4.0.0 when you don't want to update to next minor. Both ~4.0 and ^4.0 mean to stay within 4.x.x.
To get rid of those messages you could have used --with-all-dependencies instead. But agree that having them in both doesn't really make sense.
Same thing for pinning to exact versions instead of using version constraints. Would expect distributions to follow semantic versioning concerning their requirements, not pinning to exact versions. Strange for open_social 3.6 to accept AddtoAny 1.10 and open_social 4.1 to downgrade it to 1.9.