Skip to content

Commit 8e87a74

Browse files
committed
Issue #2974274 by mitrpaka, RumyanaRuseva, joachim: exception message for unrecognized source IDs in lookupDestinationIds() should have more detail
(cherry picked from commit aa577be)
1 parent c222b1e commit 8e87a74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/migrate/src/Plugin/migrate/id_map/Sql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public function lookupDestinationIds(array $source_id_values) {
584584

585585
if (!empty($source_id_values)) {
586586
$var_dump = var_export($source_id_values, TRUE);
587-
throw new MigrateException(sprintf("Extra unknown items in source IDs: %s", $var_dump));
587+
throw new MigrateException(sprintf("Extra unknown items for map %s in source IDs: %s", $this->mapTableName(), $var_dump));
588588
}
589589

590590
$query = $this->getDatabase()->select($this->mapTableName(), 'map')

modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,14 @@ public function testLookupDestinationIds() {
529529
$this->fail('Too many source IDs should throw');
530530
}
531531
catch (MigrateException $e) {
532-
$this->assertEquals("Extra unknown items in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
532+
$this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
533533
}
534534
try {
535535
$id_map->lookupDestinationIds(['nid' => 1, 'aaa' => '2']);
536536
$this->fail('Unknown source ID key should throw');
537537
}
538538
catch (MigrateException $e) {
539-
$this->assertEquals("Extra unknown items in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
539+
$this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
540540
}
541541

542542
// Verify that we are looking up by source_id_hash when all source IDs are

0 commit comments

Comments
 (0)