Skip to content
Snippets Groups Projects
Unverified Commit f21dc669 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3254347 by murilohp, joachim, danflanagan8, quietone: Add the process...

Issue #3254347 by murilohp, joachim, danflanagan8, quietone: Add the process plugin ID to migration exception message
parent f29ceb64
No related branches found
No related tags found
38 merge requests!7471uncessary 5 files are moved from media-library folder to misc folder,!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!54479.5.x SF update,!5014Issue #3071143: Table Render Array Example Is Incorrect,!4868Issue #1428520: Improve menu parent link selection,!4289Issue #1344552 by marcingy, Niklas Fiekas, Ravi.J, aleevas, Eduardo Morales...,!4114Issue #2707291: Disable body-level scrolling when a dialog is open as a modal,!3630Issue #2815301 by Chi, DanielVeza, kostyashupenko, smustgrave: Allow to create...,!3291Issue #3336463: Rewrite rules for gzipped CSS and JavaScript aggregates never match,!3143Issue #3313342: [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28,!3102Issue #3164428 by DonAtt, longwave, sahil.goyal, Anchal_gupta, alexpott: Use...,!2853#3274419 Makes BaseFieldOverride inherit the internal property from the base field.,!2719Issue #3110137: Remove Classy from core.,!2437Issue #3238257 by hooroomoo, Wim Leers: Fragment link pointing to <textarea>...,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2074Issue #2707689: NodeForm::actions() checks for delete access on new entities,!2062Issue #3246454: Add weekly granularity to views date sort,!1974Issue #3036862 demonstration,!1591Issue #3199697: Add JSON:API Translation experimental module,!1484Exposed filters get values from URL when Ajax is on,!1255Issue #3238922: Refactor (if feasible) uses of the jQuery serialize function to use vanillaJS,!1254Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS,!1162Issue #3100350: Unable to save '/' root path alias,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!957Added throwing of InvalidPluginDefinitionException from getDefinition().,!925Issue #2339235: Remove taxonomy hard dependency on node module,!877Issue #2708101: Default value for link text is not saved,!873Issue #2875228: Site install not using batch API service,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!844Resolve #3036010 "Updaters",!712Issue #2909128: Autocomplete intermittent on Chrome Android,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!485Sets the autocomplete attribute for username/password input field on login form.,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
......@@ -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);
}
......
......@@ -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();
}
}
......
......@@ -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.
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment