Let's say composer_manager was used to install the Address module.
Then, Commerce is added to the mix, and it brings a drupal/address requirement.
Composer won't know that the address module is already there, but will redownload it instead.

Discussing this at DrupalCon we concluded this is probably not the desired behavior.
Instead, we should add drupal/address to the "replace" list, so that the already present version is used instead.

Comments

bojanz created an issue. See original summary.

bojanz’s picture

There's a question of which version to use in the replace list. We can at least use "8.*", meaning "the package we already have at least starts with a 8.".
We can be more precise if the package declares a branch-alias (indicating which branch it is).
For example:

{
    "extra": {
        "branch-alias": {
            "dev-master": "8.1.x-dev"
        }
    }
}

We should advise package authors to add this. It's a Composer best practise as well.

bojanz’s picture

Status: Active » Fixed

Committed.

  • bojanz committed 246c80c on 8.x-1.x
    Issue #2595225 by bojanz: Add the managed extensions to the replace list
    

Status: Fixed » Closed (fixed)

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