diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php index cdc96c455bc02d063704262d7a7a71f7072cf990..e399ffea846b1d8c2fd63b0c52468c97a94f3d7a 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php @@ -207,7 +207,7 @@ public function testDatetimeFields() { $migration = $this->getMigration('d7_field'); $messages = iterator_to_array($migration->getIdMap()->getMessages()); $this->assertCount(5, $messages); - $msg = "d7_field:type: Can't migrate field 'field_event' with 'todate' settings. Enable the datetime_range module. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#datetime"; + $msg = "d7_field:type:process_field: Can't migrate field 'field_event' with 'todate' settings. Enable the datetime_range module. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#datetime"; $this->assertSame($messages[4]->message, $msg); } diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php index 24fe07ae4b5b83bf16416a6cfe6be510745bdd80..50b75727c2fc53c0632c65d2e6bfb191f889e1a6 100644 --- a/core/modules/migrate/src/MigrateExecutable.php +++ b/core/modules/migrate/src/MigrateExecutable.php @@ -224,7 +224,7 @@ public function import() { } catch (MigrateException $e) { $this->getIdMap()->saveIdMapping($row, [], $e->getStatus()); - $msg = sprintf("%s:%s: %s", $this->migration->getPluginId(), $destination_property_name, $e->getMessage()); + $msg = sprintf("%s:%s:%s", $this->migration->getPluginId(), $destination_property_name, $e->getMessage()); $this->saveMessage($msg, $e->getLevel()); $save = FALSE; } @@ -432,6 +432,11 @@ protected function processPipeline(Row $row, string $destination, array $plugins $new_value[] = NULL; $break = TRUE; } + catch (MigrateException $e) { + // Prepend the process plugin id to the message. + $message = sprintf("%s: %s", $plugin->getPluginId(), $e->getMessage()); + throw new MigrateException($message); + } } $value = $new_value; if ($break) { @@ -446,6 +451,12 @@ protected function processPipeline(Row $row, string $destination, array $plugins $value = NULL; break; } + catch (MigrateException $e) { + // Prepend the process plugin id to the message. + $message = sprintf("%s: %s", $plugin->getPluginId(), $e->getMessage()); + throw new MigrateException($message); + } + $multiple = $plugin->multiple(); } } diff --git a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php index 6048f740eeeecf74067086cc04c6d57aac32c564..26f2f3527fcbc5cb4b62fdcf095084ea558b5aba 100644 --- a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php +++ b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php @@ -77,7 +77,7 @@ public function testExceptionThrow() { $message = reset($messages); $id = $migration->getPluginId(); - $this->assertEquals("$id:uri: Client error: `GET $invalid_url` resulted in a `404 Not Found` response ($invalid_url)", $message->message); + $this->assertEquals("$id:uri:download: Client error: `GET $invalid_url` resulted in a `404 Not Found` response ($invalid_url)", $message->message); $this->assertEquals(MigrationInterface::MESSAGE_ERROR, $message->level); // Check that the second row was migrated successfully. diff --git a/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php b/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php index 9f8d12edd49cf4e5bf63f09bd4cd0b51b32b98c4..7b87c0849a7c4cc6d9364098316bd55d6eaf3728 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php @@ -95,7 +95,7 @@ public function testMessagesTeed() { $executable->import(); $this->assertCount(1, $this->messages); $id = $this->migration->getPluginId(); - $this->assertSame("source_message: $id:message: 'a message' is not an array", reset($this->messages)); + $this->assertSame("source_message: $id:message:concat: 'a message' is not an array", reset($this->messages)); } /** @@ -112,7 +112,7 @@ public function testGetMessages() { 'msgid' => '1', Sql::SOURCE_IDS_HASH => '170cde81762e22552d1b1578cf3804c89afefe9efbc7cc835185d7141060b032', 'level' => '1', - 'message' => "$id:message: 'a message' is not an array", + 'message' => "$id:message:concat: 'a message' is not an array", ]; $executable = new MigrateExecutable($this->migration, $this); $executable->import();