summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlex Pott2018-12-13 18:52:35 (GMT)
committerAlex Pott2018-12-13 18:52:44 (GMT)
commit30d14f9c2e67d6318bfcb72be27bab4bfdebc018 (patch)
tree1378d8a0b05b7c948557edc9617d89df960d95f5 /core
parentc490e4029c0400b51c7a337c82a1085a8143dfc1 (diff)
Issue #2974274 by mitrpaka, RumyanaRuseva, joachim: exception message for unrecognized source IDs in lookupDestinationIds() should have more detail
(cherry picked from commit aa577bef9235f4a2b623dbde0c160d77c4721a56)
Diffstat (limited to 'core')
-rw-r--r--core/modules/migrate/src/Plugin/migrate/id_map/Sql.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 0de8348..216eecd 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -584,7 +584,7 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
if (!empty($source_id_values)) {
$var_dump = var_export($source_id_values, TRUE);
- throw new MigrateException(sprintf("Extra unknown items in source IDs: %s", $var_dump));
+ throw new MigrateException(sprintf("Extra unknown items for map %s in source IDs: %s", $this->mapTableName(), $var_dump));
}
$query = $this->getDatabase()->select($this->mapTableName(), 'map')
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
index b0f3d1a..417ede6 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
@@ -529,14 +529,14 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
$this->fail('Too many source IDs should throw');
}
catch (MigrateException $e) {
- $this->assertEquals("Extra unknown items in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
+ $this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 0 => 3,\n)", $e->getMessage());
}
try {
$id_map->lookupDestinationIds(['nid' => 1, 'aaa' => '2']);
$this->fail('Unknown source ID key should throw');
}
catch (MigrateException $e) {
- $this->assertEquals("Extra unknown items in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
+ $this->assertEquals("Extra unknown items for map migrate_map_sql_idmap_test in source IDs: array (\n 'aaa' => '2',\n)", $e->getMessage());
}
// Verify that we are looking up by source_id_hash when all source IDs are