Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Composer 1 vs 2: Adds extra sites/ directory for Drupal 7 installation #479

@paul-m

Description

@paul-m

Thanks in advance for any effort at all on this. :-)

I use composer-installers to put Drupal stuff where it belongs. See my minimal composer.json below for an example of how this works.

Using Composer 1, this works as expected: Drupal core is placed in docroot/ without any problem.

Using Composer 2, everything works as expected again, except for one extra bit of path is inserted to docroot/sites/sites/. It should only be docroot/sites/.

This doesn't make a lot of sense because the whole package should just be placed within the custom directory. This is the only directory that has any special cases... Other directories within drupal/drupal are not misplaced.

This issue only happens with custom path configurations for both drupal-core and drupal-module. I would expect that if there were a problem, it would be with one overwriting the other, not adding a bonus directory.

% composer show composer/installers | grep versions
versions : * v1.10.0
% composer --version
Composer version 2.0.11 2021-02-24 14:57:23

composer.json:

{
    "name": "foo/bar",
    "type": "project",
    "config": {
        "sort-packages": true,
        "platform": {
            "php": "7.3"
        }
    },
    "require": {
        "composer/installers": "@stable",
        "drupal/ctools": "1.17",
        "drupal/drupal": "7.78"
    },
    "extra": {
        "installer-paths": {
            "docroot": [
                "type:drupal-core"
            ],
            "docroot/sites/all/modules/contrib/{$name}": [
                "type:drupal-module"
            ]
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/7"
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions