Problem/Motivation

Running Drupal Core 9.1.0 and Drush 10.3.6
Just updated today to the latest 2.1.0-beta-2 and run a migration that was previously working with last release, this error is thrown:

[error]  TypeError: Argument 3 passed to Drupal\migrate_run\Event\MigratePrepareRowEvent::__construct() must be an instance of Drupal\migrate_run\Event\MigrationInterface, instance of Drupal\migrate\Plugin\Migration given, called in /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/migrate_run.module on line 18 in Drupal\migrate_run\Event\MigratePrepareRowEvent->__construct() (line 47 of /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Event/MigratePrepareRowEvent.php) #0 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/migrate_run.module(18): Drupal\migrate_run\Event\MigratePrepareRowEvent->__construct()
#1 [internal function]: migrate_run_migrate_prepare_row()
#2 /home/andres/www/drupal9/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array()
#3 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(244): Drupal\Core\Extension\ModuleHandler->invokeAll()
#4 /home/andres/www/drupal9/docroot/modules/custom/antrecu_migrate/src/Plugin/migrate/source/ContentEntityAltern.php(270): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->prepareRow()
#5 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(374): Drupal\antrecu_migrate\Plugin\migrate\source\ContentEntityAltern->prepareRow()
#6 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(330): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->next()
#7 /home/andres/www/drupal9/docroot/core/modules/migrate/src/MigrateExecutable.php(188): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->rewind()
#8 /home/andres/www/drupal9/docroot/vendor/drush/drush/includes/drush.inc(206): Drupal\migrate\MigrateExecutable->import()
#9 /home/andres/www/drupal9/docroot/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array()
#10 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Commands/MigrateRunCommands.php(620): drush_op()
#11 [internal function]: Drupal\migrate_run\Commands\MigrateRunCommands->executeMigration()
#12 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Commands/MigrateRunCommands.php(270): array_walk()
#13 [internal function]: Drupal\migrate_run\Commands\MigrateRunCommands->import()
#14 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#15 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#16 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#17 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process()
#18 /home/andres/www/drupal9/docroot/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#19 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#20 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#21 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#22 /home/andres/www/drupal9/docroot/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#23 /home/andres/www/drupal9/docroot/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun()
#24 /home/andres/www/drupal9/docroot/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#25 /home/andres/www/drupal9/docroot/vendor/drush/drush/drush(4): require('/home/andres/ww...')
#26 {main}.
TypeError: Argument 3 passed to Drupal\migrate_run\Event\MigratePrepareRowEvent::__construct() must be an instance of Drupal\migrate_run\Event\MigrationInterface, instance of Drupal\migrate\Plugin\Migration given, called in /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/migrate_run.module on line 18 in /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Event/MigratePrepareRowEvent.php on line 47 #0 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/migrate_run.module(18): Drupal\migrate_run\Event\MigratePrepareRowEvent->__construct()
#1 [internal function]: migrate_run_migrate_prepare_row()
#2 /home/andres/www/drupal9/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array()
#3 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(244): Drupal\Core\Extension\ModuleHandler->invokeAll()
#4 /home/andres/www/drupal9/docroot/modules/custom/antrecu_migrate/src/Plugin/migrate/source/ContentEntityAltern.php(270): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->prepareRow()
#5 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(374): Drupal\antrecu_migrate\Plugin\migrate\source\ContentEntityAltern->prepareRow()
#6 /home/andres/www/drupal9/docroot/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(330): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->next()
#7 /home/andres/www/drupal9/docroot/core/modules/migrate/src/MigrateExecutable.php(188): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->rewind()
#8 /home/andres/www/drupal9/docroot/vendor/drush/drush/includes/drush.inc(206): Drupal\migrate\MigrateExecutable->import()
#9 /home/andres/www/drupal9/docroot/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array()
#10 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Commands/MigrateRunCommands.php(620): drush_op()
#11 [internal function]: Drupal\migrate_run\Commands\MigrateRunCommands->executeMigration()
#12 /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Commands/MigrateRunCommands.php(270): array_walk()
#13 [internal function]: Drupal\migrate_run\Commands\MigrateRunCommands->import()
#14 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#15 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#16 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#17 /home/andres/www/drupal9/docroot/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process()
#18 /home/andres/www/drupal9/docroot/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#19 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#20 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#21 /home/andres/www/drupal9/docroot/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#22 /home/andres/www/drupal9/docroot/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#23 /home/andres/www/drupal9/docroot/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun()
#24 /home/andres/www/drupal9/docroot/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#25 /home/andres/www/drupal9/docroot/vendor/drush/drush/drush(4): require('/home/andres/ww...')
#26 {main}
TypeError: Argument 3 passed to Drupal\migrate_run\Event\MigratePrepareRowEvent::__construct() must be an instance of Drupal\migrate_run\Event\MigrationInterface, instance of Drupal\migrate\Plugin\Migration given, called in /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/migrate_run.module on line 18 in Drupal\migrate_run\Event\MigratePrepareRowEvent->__construct() (line 47 of /home/andres/www/drupal9/docroot/modules/contrib/migrate_run/src/Event/MigratePrepareRowEvent.php).
 [warning] Drush command terminated abnormally.

Steps to reproduce

drush mim any_migration --update

CommentFileSizeAuthor
#4 3187254-4.patch430 bytesandres.torres
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andres.torres created an issue. See original summary.

andres.torres’s picture

Issue summary: View changes
andres.torres’s picture

seems that:

use Drupal\migrate\Plugin\MigrationInterface;

is missing in MigratePrepareRowEvent.php

andres.torres’s picture

FileSize
430 bytes

Attaching path for review

andres.torres’s picture

Status: Active » Needs review
claudiu.cristea’s picture

Title: Latest Release 2.1.0-beta-2 breaks Drush » Latest Release 2.1.0-beta2 is broken
Status: Needs review » Reviewed & tested by the community

Thank you for reporting. Yes, this was removed by mistake in 27ab868. I will fix it very soon and release a new beta.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Fixed. Released a new 2.1.0-beta4 containing the fix.

claudiu.cristea’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.