Commit 45b87d82 authored by catch's avatar catch

Issue #2679913 by kekkis, xjm, quietone: Fix use of markup in strings in Migrate UI

parent 65a01a77
......@@ -764,7 +764,7 @@ public function buildOverviewForm(array $form, FormStateInterface $form_state) {
$form['upgrade_option_item'] = [
'#type' => 'item',
'#prefix' => $this->t('An upgrade has already been performed on this site. To perform a new migration, create a clean and empty new install of Drupal 8. Rollbacks and incremental migrations are not yet supported through the user interface. For more information, see the <a href=":url">upgrading handbook</a>.', [':url' => 'https://www.drupal.org/upgrade/migrate']),
'#description' => $this->t('<p>Last upgrade: @date</p>', ['@date' => $this->dateFormatter->format($date_performed)]),
'#description' => $this->t('Last upgrade: @date', ['@date' => $this->dateFormatter->format($date_performed)]),
];
return $form;
}
......@@ -981,16 +981,10 @@ public function validateCredentialForm(array &$form, FormStateInterface $form_st
}
catch (\Exception $e) {
$error_message = [
'#type' => 'inline_template',
'#template' => '{% trans %}Resolve the issue below to continue the upgrade.{% endtrans%}{{ errors }}',
'#context' => [
'errors' => [
'#theme' => 'item_list',
'#items' => [$e->getMessage()],
],
],
'#title' => $this->t('Resolve the issue below to continue the upgrade.'),
'#theme' => 'item_list',
'#items' => [$e->getMessage()],
];
$form_state->setErrorByName($database['driver'] . '][0', $this->renderer->renderPlain($error_message));
}
}
......@@ -1103,8 +1097,12 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) {
];
}
$form['counts'] = [
'#type' => 'item',
'#title' => '<ul><li>' . $this->t('@count available upgrade paths', ['@count' => $available_count]) . '</li><li>' . $this->t('@count missing upgrade paths', ['@count' => $missing_count]) . '</li></ul>',
'#title' => 'Upgrade analysis report',
'#theme' => 'item_list',
'#items' => [
$this->formatPlural($available_count, '@count available upgrade path', '@count available upgrade paths'),
$this->formatPlural($missing_count, '@count missing upgrade path', '@count missing upgrade paths'),
],
'#weight' => -15,
];
......@@ -1172,7 +1170,9 @@ public function getCancelUrl() {
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('<p><strong>Upgrade analysis report</strong></p>');
// The description is added by the buildConfirmForm() method.
// @see \Drupal\migrate_drupal_ui\Form\MigrateUpgradeForm::buildConfirmForm()
return;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment