Problem/Motivation
If a migration has multiple source keys, but you don't give enough values in the --idlist option, then you get this crash:
[error] TypeError: Argument 1 passed to Drupal\migrate\Plugin\migrate\id_map\Sql::setUpdate() must be of the type array, bool given, called in /var/www/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php on line 883 in Drupal\migrate\Plugin\migrate\id_map\Sql->setUpdate() (line 844 of /var/www/web/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php) #0 /var/www/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php(883): Drupal\migrate\Plugin\migrate\id_map\Sql->setUpdate(false)
#1 [internal function]: Drupal\migrate_tools\Commands\MigrateToolsCommands->executeMigration(Object(Drupal\migrate\Plugin\Migration), 'two_images_para...', Array)
This is because array_combine() returns FALSE if the two arrays aren't of equal length:
$migration->getIdMap()->setUpdate(array_combine($keys, $source_id_values));
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
joachim commentedI've got rough working code for this, will clean up and make a MR soon.
Comment #3
ayalon commentedI have the same issue and I am very interessted in your fix.
Comment #4
joachim commentedSorry, I got the issues about idlist mixed up -- it's #3248506: import using --idlist parameter should warn if an idlist value wasn't in the source values I have a fix for.
Comment #5
vensiresComment #6
vensiresClosing this as outdated as it is no longer relevant to the latest 6.1.x version.