craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.21k stars 624 forks source link

Error when installing some plugins from the plugin store on RC1 #2124

Closed angrybrad closed 6 years ago

angrybrad commented 6 years ago

Description

On the release/3.0.0-RC1 branch, you get an error when installing some plugins from the plugin store.

Error: Argument 1 passed to Composer\Package\Package::setIncludePaths() must be of the type array, string given, called in /path/to/craft3.dev/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php on line 148

Output: Loading composer repositories with package information
Updating dependencies

Reports so far:

Additional info

ostark commented 6 years ago

Same error with ImageOptimize on /admin/update?install=image-optimize:1.3.2

brandonkelly commented 6 years ago

@ostark I’m not able to reproduce this. Can you try composer-update’ing and re-installing ImageOptimize? Maybe we fixed something.

narration-sd commented 6 years ago

still there - just got it on CraftQL, support req in before knew about this issue - blame the easy cp reporting...

narration-sd commented 6 years ago

versions block, if it's any help

PHP version 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 Database driver & version MySQL 5.7.20-0ubuntu0.16.04.1 Image driver & version GD 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 Craft edition & version Craft Personal 3.0.0-RC1 Yii version 2.0.13.1 Twig version 2.4.4 Guzzle version 6.2.1 Imagine version 0.7-dev

eriweb commented 6 years ago

seems to be a bug in composer, in composer's src/Composer/Package/Loader/ArrayLoader.php:L148 it doesn't seem to deserialze $config['include-path'] and passes it as a literal string: type: string content: "[\"\",\"..\/..\/symfony\/yaml\/\"]". Of the packages my install is trying it seems to be only (older) versions of phpunit that actually has include-path in composer.json

if I change that line (L148) to $package->setIncludePaths(json_decode($config['include-path'])); it seems to continue

ostark commented 6 years ago

The use of include-path in composer.json is deprecated and was removed in PHPUnit 4.4 https://github.com/sebastianbergmann/phpunit/commit/2daecbff094bea89224453d031c918b3b60de875

I see that the [\"\",\"..\/..\/symfony\/yaml\/\"] string get passed as well - but I'm locked to ~4.4 - that's odd.

brandonkelly commented 6 years ago

Thanks everyone! This should be fixed now.