drupal-composer / preserve-paths

A composer plugin for keeping specified files and directories when installing/updating new composer packages. Can be used to supported nested packages.
28 stars 28 forks source link

Error on 'null' paths for metapackages #43

Open lazysoundsystem opened 1 year ago

lazysoundsystem commented 1 year ago

A recent change in composer - https://github.com/composer/composer/pull/11455 - now breaks preserve-paths when it deals with metapackages.

Error: Composer\Util\Filesystem::isAbsolutePath(): Argument #1 ($path) must be of type string, null given, called in .../vendor/drupal-composer/preserve-paths/src/PluginWrapper.php on line 190

See also https://github.com/laminas/laminas-component-installer/issues/69

driskell commented 1 year ago

Reproduction case in #42 reproduces this every time.

lazysoundsystem commented 1 year ago

Confirming that, as suggested in https://github.com/drupal-composer/preserve-paths/issues/44, sticking with composer version 2.5.5 avoids this issue until this package is updated.

paul-m commented 1 year ago

Workaround using lazysoundsystem's repo:

    "repositories": {
        "preserve-paths-fix": {
            "type": "vcs",
            "url": "https://github.com/lazysoundsystem/preserve-paths",
            "only": ["drupal-composer/preserve-paths"]
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    },
    "require": {
        "drupal-composer/preserve-paths": "dev-master",
        [etc]
    }
VladimirAus commented 12 months ago

Thank you for the commit 🧁

sandykadam commented 6 months ago

You can use this updated package https://github.com/sandykadam/preserve-paths/releases/tag/0.4 to fix