drupal-composer / drupal-scaffold

:construction: Composer Plugin for updating the Drupal scaffold files when using drupal/core
191 stars 47 forks source link

Parameter must be an array or an object that implements Countable #80

Closed pingers closed 6 years ago

pingers commented 6 years ago

I received the following error when the scaffold was trying to download "initial" files during composer install, but they already exist and there are no curl requests to make.

Script DrupalComposer\DrupalScaffold\Plugin::scaffold handling the drupal-scaffold event terminated with an exception
[ErrorException]                                                            
  count(): Parameter must be an array or an object that implements Countable

This solves the problem by avoiding "curling" when there's nothing to curl. The actual error is because curl never gets set up correctly and then when it gets to the do while in fetchWithPrestissimo(), $multi->remain() returns NULL (because it was never initialised).

emerham commented 6 years ago

I also get this same error when running composer update, applying this fix does allow for update to finish cleanly

webflo commented 6 years ago

Released as 2.5.1

Thanks for your help!