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

Loketony created an issue. See original summary.

chlodewig’s picture

Change in: DIR/composer.json

"goalgorilla/open_social": "~3.0",
to
"goalgorilla/open_social": "~4.0",

Then run: composer update

Loketony’s picture

Thanks for input. I changed in composer.json to:

"goalgorilla/open_social": ">=4.0"

But got:

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
    - goalgorilla/open_social 4.1.0 requires drupal-composer/drupal-scaffold ^2.5.0 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4] but these conflict with your requirements or minimum-stability.
    - goalgorilla/open_social 4.0.0 requires drupal-composer/drupal-scaffold ^2.5.0 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4] but these conflict with your requirements or minimum-stability.
    - Installation request for goalgorilla/open_social >=4.0 -> satisfiable by goalgorilla/open_social[4.0.0, 4.1.0].
Loketony’s picture

Thanks for input! I edited composer.json:

"goalgorilla/open_social": ">=4.0"

But I got this:

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
    - goalgorilla/open_social 4.1.0 requires drupal-composer/drupal-scaffold ^2.5.0 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4] but these conflict with your requirements or minimum-stability.
    - goalgorilla/open_social 4.0.0 requires drupal-composer/drupal-scaffold ^2.5.0 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4] but these conflict with your requirements or minimum-stability.
    - Installation request for goalgorilla/open_social >=4.0 -> satisfiable by goalgorilla/open_social[4.0.0, 4.1.0].

I guess I have to install drupal-scaffold version 2.5.0 somehow? ...

Loketony’s picture

Solved!

I decided to try get rid of all the warning messages (see first post); so I deleted from composer.json:

"composer/installers": "^1.0",
"drupal-composer/drupal-scaffold": "dev-master",
"cweagans/composer-patches": "^1.0",
"doctrine/common": "2.7.2",
"doctrine/collections": "1.4.0",
"doctrine/cache": "1.6.1",
"doctrine/inflector": "1.1.0",

and edited this line:

"php": "^5.6 || ^7.0",

to

"php": "^7.0",

and now when I issue this command:

composer update goalgorilla/open_social --with-dependencies

it finally worked as expected!

- Updating goalgorilla/open_social (3.6.0 => 4.1.0)
- Downgrading drupal-composer/drupal-scaffold (dev-master 756910b => 2.5.4)
- Installing npm-asset/jquery (3.3.1)
- Installing npm-asset/fortawesome--fontawesome-free-webfonts (1.0.9)
- Installing npm-asset/shariff (3.0.1)
- Updating doctrine/collections (v1.4.0 => v1.5.0)
- Installing doctrine/reflection (v1.0.0)
- Installing doctrine/event-manager (v1.0.0)
- Installing doctrine/persistence (v1.1.0)
- Updating doctrine/common (v2.7.2 => v2.10.0)
- Installing drupal/shariff (1.3.0)
- Applying patches for drupal/shariff
    https://www.drupal.org/files/issues/2018-09-17/shariff-libraries_path_with_composer-2987789-5.patch (Allow shariff to use composer)
- Downgrading drupal/addtoany (1.10.0 => 1.9.0)
- Updating doctrine/cache (v1.6.1 => v1.8.0)
- Updating doctrine/inflector (v1.1.0 => v1.3.0)

Thanks for leading me into the right direction! :-)

jaapjan’s picture

Status: Active » Needs review

That 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.

jaapjan’s picture

Category: Bug report » Support request
Loketony’s picture

Interesting. 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:

"composer/installers": "^1.0",
"drupal-composer/drupal-scaffold": "dev-master",
"cweagans/composer-patches": "^1.0",
"doctrine/common": "2.7.2",
"doctrine/collections": "1.4.0",
"doctrine/cache": "1.6.1",
"doctrine/inflector": "1.1.0",

Then I changed the versions of Open Social and PHP I want by editing the same file:

 "goalgorilla/open_social": "^3.5",
 "php": "^5.6 || ^7.0",

to:

"goalgorilla/open_social": ">=4.0",
"php": "^7.0",

Now my terminal purred like a cat and everything went smoothly:

- Updating goalgorilla/open_social (3.6.0 => 4.1.0)
- Downgrading drupal-composer/drupal-scaffold (dev-master 756910b => 2.5.4)
- Installing npm-asset/jquery (3.3.1)
- Installing npm-asset/fortawesome--fontawesome-free-webfonts (1.0.9)
- Installing npm-asset/shariff (3.0.1)
- Updating doctrine/collections (v1.4.0 => v1.5.0)
- Installing doctrine/reflection (v1.0.0)
- Installing doctrine/event-manager (v1.0.0)
- Installing doctrine/persistence (v1.1.0)
- Updating doctrine/common (v2.7.2 => v2.10.0)
- Installing drupal/shariff (1.3.0)
- Applying patches for drupal/shariff
https://www.drupal.org/files/issues/2018-09-17/shariff-libraries_path_with_composer-2987789-5.patch (Allow shariff to use composer)
- Downgrading drupal/addtoany (1.10.0 => 1.9.0)
- Updating doctrine/cache (v1.6.1 => v1.8.0)
- Updating doctrine/inflector (v1.1.0 => v1.3.0)

:-) = Happy again!

jaapjan’s picture

Status: Needs review » Fixed

Good to hear, thanks for sharing your solution!

mmjvb’s picture

Doubt 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.