Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#4 | 3187254-4.patch | 430 bytes | andres.torres |
Comments
Comment #2
andres.torres CreditAttribution: andres.torres commentedComment #3
andres.torres CreditAttribution: andres.torres commentedseems that:
use Drupal\migrate\Plugin\MigrationInterface;
is missing in MigratePrepareRowEvent.php
Comment #4
andres.torres CreditAttribution: andres.torres commentedAttaching path for review
Comment #5
andres.torres CreditAttribution: andres.torres commentedComment #6
claudiu.cristeaThank you for reporting. Yes, this was removed by mistake in 27ab868. I will fix it very soon and release a new beta.
Comment #8
claudiu.cristeaFixed. Released a new 2.1.0-beta4 containing the fix.
Comment #9
claudiu.cristea