Skip to content

Conversation

bpresles
Copy link
Contributor

@bpresles bpresles commented Dec 15, 2016

When the devel's webprofiler submodule is activated, the migre:setup command fails with the following exception:

TypeError: Argument 1 passed to Drupal\Console\Command\Migrate\SetupCommand::__construct() must be an instance of Drupal\Core\State\State, instance of Drupal\webprofiler\State\StateWrapper given in /srv/www/drupal/src/vendor/drupal/console/src/Command/Migrate/SetupCommand.php on line 44 #0 [internal function]: Drupal\Console\Command\Migrate\SetupCommand->__construct(Object(Drupal\webprofiler\State\StateWrapper), Object(Drupal\migrate\Plugin\MigrationPluginManager))
#1 /srv/www/drupal/src/vendor/symfony/dependency-injection/ContainerBuilder.php(928): ReflectionClass->newInstanceArgs(Array)
#2 /srv/www/drupal/src/vendor/symfony/dependency-injection/ContainerBuilder.php(468): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), 'migrate_setup')
#3 /srv/www/drupal/src/vendor/drupal/console/src/Application.php(143): Symfony\Component\DependencyInjection\ContainerBuilder->get('migrate_setup')
#4 /srv/www/drupal/src/vendor/drupal/console/src/Application.php(38): Drupal\Console\Application->registerCommands()
#5 /srv/www/drupal/src/vendor/symfony/console/Application.php(124): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /srv/www/drupal/src/vendor/drupal/console/bin/drupal.php(70): Symfony\Component\Console\Application->run()
#7 /srv/www/drupal/src/vendor/drupal/console/bin/drupal(4): require('/srv/www/drupal...')
#8 {main}
TypeError: Argument 1 passed to Drupal\Console\Command\Migrate\SetupCommand::__construct() must be an instance of Drupal\Core\State\State, instance of Drupal\webprofiler\State\StateWrapper given in Drupal\Console\Command\Migrate\SetupCommand->__construct() (line 44 of /srv/www/drupal/src/vendor/drupal/console/src/Command/Migrate/SetupCommand.php).

This pull request offer a fix by using Drupal\Core\State\StateInterface instead of Drupal\Core\State\State as type for the first constructor argument of this command, to make it compatible with any implementation of state service.

@jmolivas jmolivas merged commit 10d7d49 into hechoendrupal:master Dec 17, 2016
@jmolivas
Copy link
Member

@bpresles Thanks for your contribution, your PR was merged. This will be included on the next release.

@jmolivas jmolivas modified the milestone: 1.0.0-rc12 Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants