diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php index 734cab05a6..cf17246ea9 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php @@ -296,11 +296,11 @@ protected function getDefinitionFromEntity($key) { * {@inheritdoc} */ public function getHighestId() { - $query = $this->storage->getQuery() + $values = $this->storage->getQuery() ->sort($this->getKey('id'), 'DESC') - ->range(0, 1); - $result = $query->execute(); - return (int) reset($result); + ->range(0, 1) + ->execute(); + return (int) current($values); } } diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php index a3c1e6a853..290c1e1b5a 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php @@ -97,11 +97,14 @@ public function getIds() { * {@inheritdoc} */ public function getHighestId() { - $query = $this->storage->getQuery() + $values = $this->storage->getQuery() + ->allRevisions() ->sort($this->getKey('revision'), 'DESC') - ->range(0, 1); - $result = $query->execute(); - return (int) reset($result); + ->range(0, 1) + ->execute(); + // The array keys are the revision IDs. + // The array contains only one entry, so we can use key(). + return (int) key($values); } } 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 be0428162c..8bc17f19f5 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -990,7 +990,7 @@ function (array $id) { } // Return the highest of all the mapped IDs. - return max($ids); + return (int) max($ids); } } diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 08a0498d21..9c05b6232c 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -507,7 +507,7 @@ public function buildIdConflictForm(array &$form, FormStateInterface $form_state $form['warning'] = [ '#type' => 'markup', - '#markup' => '
' . $this->t('Upgrades work on clean and empty new installs of Drupal 8. However, it looks like you have content in your site that is unknown to the migrate system; perhaps manually added. These new entities may be overwritten if you run this upgrade. For more information, see the online handbook entry for handling migration conflicts.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '
'; + $form['warning']['#markup'] .= '' . $this->t('The upgrade should be performed on a clean Drupal 8 installation. It looks like you have content on your site which may be overwritten if you continue to run the upgrade. For more information, refer to the upgrade handbook.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '
'; $form['conflicts'] = [ '#title' => $this->t('The conflicting content are of the following types:'), @@ -587,7 +587,7 @@ protected function formatConflicts(array $conflicts) { * The form structure. */ protected function i18nWarningForm(array &$form, FormStateInterface $form_state, array $conflicts) { - $form['warning']['#markup'] .= '' . $this->t('It looks like you are migrating translated content. Be extra cautious and make sure you aren\'t introducting any conflicts. For more on the subject, see the online handbook entry for handling migration conflicts.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '
'; + $form['warning']['#markup'] .= '' . $this->t('It looks like you are migrating translated content. The possible ID conflicts for translations are not automatically detected in the current version of Drupal. Refer to the upgrade handbook for instructions on how to avoid ID conflicts with translated content.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '
'; $form['i18n'] = [ '#title' => $this->t('The translated content are of the following types:'),