diff --git a/core/modules/migrate/src/MigrateIdAuditor.php b/core/modules/migrate/src/MigrateIdAuditor.php index 19f92cb..03a8fe9 100644 --- a/core/modules/migrate/src/MigrateIdAuditor.php +++ b/core/modules/migrate/src/MigrateIdAuditor.php @@ -2,34 +2,35 @@ namespace Drupal\migrate; -use Drupal\migrate\Plugin\MigrateIdAuditInterface; +use Drupal\migrate\Plugin\MigrateDestinationAuditInterface; /** - * Audits migrations for potential ID conflicts. + * Audits a set of migrations for potential ID conflicts. */ class MigrateIdAuditor { /** - * Audit a set of migrations for ID conflicts. + * Audits a set of migrations for potential ID conflicts. * * @param \Drupal\migrate\Plugin\MigrationInterface[] $migrations - * The migrations to audit. + * The set of migrations to audit. * * @return string[] - * The entity type IDs of migrated content that may have problematic - * IDs. If no problems are found, an empty array will be returned. + * The entity type IDs of migrated content that may have conflicting IDs. + * If no conflicts are found, an empty array will be returned. */ public function auditIds(array $migrations) { - $ret = []; + $conflicts = []; foreach ($migrations as $migration) { $destination = $migration->getDestinationPlugin(); - if ($destination instanceof MigrateIdAuditInterface) { - if ($destination->unsafeIdsExist($migration->getIdMap())) { - $ret[$destination->entityTypeId()] = TRUE; + if ($destination instanceof MigrateDestinationAuditInterface) { + if ($destination->hasIdConflicts($migration->getIdMap())) { + $entity_type = $destination->getEntityType(); + $conflicts[$entity_type->id()] = $entity_type->getLabel(); } } } - return array_keys($ret); + return $conflicts; } } diff --git a/core/modules/migrate/src/Plugin/MigrateDestinationAuditInterface.php b/core/modules/migrate/src/Plugin/MigrateDestinationAuditInterface.php new file mode 100644 index 0000000..9592679 --- /dev/null +++ b/core/modules/migrate/src/Plugin/MigrateDestinationAuditInterface.php @@ -0,0 +1,30 @@ +getKey('id'); + } + + /** + * Gets the highest ID that exists for this destination. + * + * This is not the highest ID that has been migrated, but the highest ID that + * exists in the destination, eg: highest node ID on the site. * * @return int - * The highest ID value found. If no IDs at all are found, or if the - * concept of a highest ID is not meaningful, zero should be returned. + * The highest ID found. If no IDs are found, or if the concept of a highest + * ID is not meaningful, zero should be returned. */ - protected function highestDestinationId() { + protected function getHighestDestinationId() { $query = $this->storage->getQuery() - ->sort($this->getHighestIdField(), 'DESC') + ->sort($this->getIdAuditField()) ->range(0, 1); $found = $query->execute(); return (int) reset($found); @@ -318,33 +329,22 @@ protected function highestDestinationId() { /** * {@inheritdoc} */ - public function getHighestIdField() { - return $this->getKey('id'); - } - - /** - * {@inheritdoc} - */ - public function unsafeIdsExist(MigrateIdMapInterface $id_map) { - // If IDs are are audited, see if there are any conflicts. + public function hasIdConflicts(MigrateIdMapInterface $id_map) { if (!empty($this->migration->getPluginDefinition()['audit_ids'])) { - if (!($id_map instanceof MigrateMaxIdInterface)) { - // We don't know how to audit IDs without a cooperating ID map. - return FALSE; - } - $highestMigrated = $id_map->getMaxId($this->getHighestIdField()); - if ($this->highestDestinationId() > $highestMigrated) { - // There's a new ID that we might conflict with! - return TRUE; + if ($id_map instanceof MigrateIdMapAuditInterface) { + if ($this->getHighestDestinationId() > $id_map->getHighestMigratedId($this->getIdAuditField())) { + return TRUE; + } } } + return FALSE; } /** * {@inheritdoc} */ - public function entityTypeId() { - return $this->storage->getEntityTypeId(); + public function getEntityType() { + return $this->storage->getEntityType(); } } diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php index b646059..e452795 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php @@ -81,7 +81,7 @@ public function getIds() { /** * {@inheritdoc} */ - public function getHighestIdField() { + public function getIdAuditField() { return $this->getKey('revision'); } 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 5e455bf..1c12a0a 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -6,7 +6,7 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\PluginBase; -use Drupal\migrate\Plugin\MigrateMaxIdInterface; +use Drupal\migrate\Plugin\MigrateIdMapAuditInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Event\MigrateIdMapMessageEvent; use Drupal\migrate\MigrateException; @@ -29,7 +29,7 @@ * * @PluginID("sql") */ -class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryPluginInterface, MigrateMaxIdInterface { +class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryPluginInterface, MigrateIdMapAuditInterface { /** * Column name of hashed source id values. @@ -942,7 +942,7 @@ public function valid() { /** * {@inheritdoc} */ - public function getMaxId($field) { + public function getHighestMigratedId($field) { $sql_field = $this->destinationIdFields()[$field]; $migration_id = $this->migration->id(); @@ -959,8 +959,7 @@ public function getMaxId($field) { if ($migration['id'] == $base_id) { // Get this derived migration's mapping table and add it to the list // of mapping tables to look in for the highest ID. - $migration['id'] = $migration_id; - $stub = $this->migrationPluginManager->createStubMigration($migration); + $stub = $this->migrationPluginManager->createInstance($migration_id); $map_tables[$migration_id] = $stub->getIdMap()->mapTableName(); } } diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php new file mode 100644 index 0000000..92f1ee7 --- /dev/null +++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php @@ -0,0 +1,102 @@ +coreModuleListDataProvider()); + parent::setUp(); + + // Install required schemas. + $this->installEntitySchema('aggregator_item'); + $this->installEntitySchema('aggregator_feed'); + $this->installEntitySchema('block_content'); + $this->installEntitySchema('comment'); + $this->installEntitySchema('file'); + $this->installEntitySchema('menu_link_content'); + $this->installEntitySchema('node'); + $this->installEntitySchema('taxonomy_term'); + $this->installSchema('dblog', ['watchdog']); + $this->installSchema('tracker', ['tracker_node', 'tracker_user']); + } + + /** + * Tests all migrations with no ID conflicts. + */ + public function testAllMigrationsWithNoConflicts() { + $plugin_manager = $this->container->get('plugin.manager.migration'); + + // Get all migration definitions. + $migrations = []; + foreach ($plugin_manager->getDefinitions() as $migration_id => $migration) { + $migrations[$migration_id] = $this->getMigration($migration_id); + } + + // Audit the IDs of all migrations. There should be no conflicts since no + // content has been created. + $conflicts = $this->container->get('migrate.id_auditor')->auditIds($migrations); + $this->assertTrue(empty($conflicts)); + } + + /** + * Tests the node migration with ID conflicts. + */ + public function testMigrationWithIdConflicts() { + // Create a node of type page. + Node::create(['type' => 'page', 'title' => 'foo'])->save(); + + // Audit the IDs of the d6_node migrations for the page & article node type. + // There should be a conflict since there's a new node that wasn't created + // from a previous migration. + $conflicts = $this->container->get('migrate.id_auditor')->auditIds([ + $this->getMigration('d6_node:article'), + $this->getMigration('d6_node:page'), + ]); + $this->assertSame(['node'], array_keys($conflicts)); + } + + /** + * Tests multiple migrations to the same destination with no ID conflicts. + */ + public function testMultipleMigrationWithoutIdConflicts() { + // Create a node of type page. + Node::create(['type' => 'page', 'title' => 'foo'])->save(); + + // Insert data in the d6_node:page migration mappping table to simulate a + // previously migrated node. + $table_name = $this->getMigration('d6_node:page')->getIdMap()->mapTableName(); + $this->container->get('database')->insert($table_name) + ->fields([ + 'source_ids_hash' => 1, + 'sourceid1' => 1, + 'destid1' => 1, + ]) + ->execute(); + + // Audit the IDs of the d6_node migrations for the page & article node type. + // There should be no conflicts since the highest destination ID should be + // equal to the highest migrated ID, as found in the aggregated mapping + // tables of the two node migrations. + $conflicts = $this->container->get('migrate.id_auditor')->auditIds([ + $this->getMigration('d6_node:page'), + $this->getMigration('d6_node:article'), + ]); + $this->assertTrue(empty($conflicts)); + } + +} diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 53a2a46..9c169e5 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -3,7 +3,6 @@ namespace Drupal\migrate_drupal_ui\Form; use Drupal\Core\Datetime\DateFormatterInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\RendererInterface; @@ -715,13 +714,6 @@ class MigrateUpgradeForm extends ConfirmFormBase { protected $pluginManager; /** - * The entity type manager. - * - * @var \Drupal\Core\Entity\EntityTypeManagerInterface - */ - protected $entityTypeManager; - - /** * The ID conflict auditor. * * @var \Drupal\migrate\MigrateIdAuditor $idAuditor @@ -739,17 +731,14 @@ class MigrateUpgradeForm extends ConfirmFormBase { * The renderer service. * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $plugin_manager * The migration plugin manager. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager. * @param \Drupal\migrate\MigrateIdAuditor $id_auditor * The ID conflict auditor. */ - public function __construct(StateInterface $state, DateFormatterInterface $date_formatter, RendererInterface $renderer, MigrationPluginManagerInterface $plugin_manager, EntityTypeManagerInterface $entity_type_manager, MigrateIdAuditor $id_auditor) { + public function __construct(StateInterface $state, DateFormatterInterface $date_formatter, RendererInterface $renderer, MigrationPluginManagerInterface $plugin_manager, MigrateIdAuditor $id_auditor) { $this->state = $state; $this->dateFormatter = $date_formatter; $this->renderer = $renderer; $this->pluginManager = $plugin_manager; - $this->entityTypeManager = $entity_type_manager; $this->idAuditor = $id_auditor; } @@ -762,7 +751,6 @@ public static function create(ContainerInterface $container) { $container->get('date.formatter'), $container->get('renderer'), $container->get('plugin.manager.migration'), - $container->get('entity_type.manager'), $container->get('migrate.id_auditor') ); } @@ -1128,8 +1116,8 @@ public function buildIdConflictForm(array &$form, FormStateInterface $form_state // Check if there are conflicts. If none, just skip this form! $migration_ids = array_keys($form_state->get('migrations')); $migrations = $this->pluginManager->createInstances($migration_ids); - $type_ids = $this->idAuditor->auditIds($migrations); - if (empty($type_ids)) { + $conflicts = $this->idAuditor->auditIds($migrations); + if (empty($conflicts)) { $form_state->set('step', 'confirm'); return $this->buildForm($form, $form_state); } @@ -1144,15 +1132,11 @@ public function buildIdConflictForm(array &$form, FormStateInterface $form_state '

' . $this->t('Upgrades work on brand new sites, or sites with previously upgraded data. 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']) . '

', ]; - $items = []; - sort($type_ids); - foreach ($type_ids as $typeId) { - $items[] = $this->entityTypeManager->getDefinition($typeId)->getLabel(); - } + sort($conflicts); $form['type_list'] = [ '#title' => $this->t('These entities are of the following types:'), '#theme' => 'item_list', - '#items' => $items, + '#items' => $conflicts, ]; return $form; diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index 82b83d2..c3a64d4 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -37,6 +37,7 @@ 'telephone', 'aggregator', 'book', + 'forum', 'statistics', ]; @@ -110,29 +111,6 @@ protected function tearDown() { * Executes all steps of migrations upgrade. */ public function testMigrateUpgrade() { - $driver = $this->sourceDatabase->getConnectionOptions()['driver']; - $edits = $this->getUiEditsArray(); - - // Ensure submitting the form with invalid database credentials gives us a - // nice warning. - $this->drupalPostForm(NULL, [$driver . '[database]' => 'wrong'] + $edits, t('Review upgrade')); - $this->assertText('Resolve the issue below to continue the upgrade.'); - - $this->drupalPostForm(NULL, $edits, t('Review upgrade')); - $this->assertResponse(200); - $this->assertText('Are you sure?'); - $this->drupalPostForm(NULL, [], t('Perform upgrade')); - $this->assertText(t('Congratulations, you upgraded Drupal!')); - - $this->runPostMigrationTests(); - } - - /** - * Build a re-usable form $edits array for the UI. - * - * @return array $edits - */ - protected function getUiEditsArray() { $connection_options = $this->sourceDatabase->getConnectionOptions(); $this->drupalGet('/upgrade'); $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.'); @@ -159,20 +137,27 @@ protected function getUiEditsArray() { if (count($drivers) !== 1) { $edit['driver'] = $driver; } - return $this->translatePostValues($edit); - } + $edits = $this->translatePostValues($edit); + + // Ensure submitting the form with invalid database credentials gives us a + // nice warning. + $this->drupalPostForm(NULL, [$driver . '[database]' => 'wrong'] + $edits, t('Review upgrade')); + $this->assertText('Resolve the issue below to continue the upgrade.'); + + $this->drupalPostForm(NULL, $edits, t('Review upgrade')); + $this->assertResponse(200); + $this->assertText('Are you sure?'); + $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data, continue anyway.')); + $this->drupalPostForm(NULL, [], t('Perform upgrade')); + $this->assertText(t('Congratulations, you upgraded Drupal!')); - /** - * Runs all post migration tests. - */ - protected function runPostMigrationTests() { - $version = $this->getLegacyDrupalVersion($this->sourceDatabase); // Have to reset all the statics after migration to ensure entities are // loadable. $this->resetAll(); $expected_counts = $this->getEntityCounts(); - foreach (array_keys(\Drupal::entityTypeManager()->getDefinitions()) as $entity_type) { + foreach (array_keys(\Drupal::entityTypeManager() + ->getDefinitions()) as $entity_type) { $real_count = \Drupal::entityQuery($entity_type)->count()->execute(); $expected_count = isset($expected_counts[$entity_type]) ? $expected_counts[$entity_type] : 0; $this->assertEqual($expected_count, $real_count, "Found $real_count $entity_type entities, expected $expected_count."); @@ -198,10 +183,12 @@ protected function runPostMigrationTests() { $this->fail($message); } else { - $this->assertTrue(TRUE, $message); + $this->pass($message); } } } + \Drupal::service('module_installer')->install(['forum']); + \Drupal::service('module_installer')->install(['book']); } /** diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php index 431d0fa..418addc 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php @@ -17,19 +17,6 @@ class MigrateUpgrade6Test extends MigrateUpgradeTestBase { /** * {@inheritdoc} */ - public static $modules = [ - 'language', - 'content_translation', - 'migrate_drupal_ui', - 'telephone', - 'aggregator', - 'book', - 'statistics', - ]; - - /** - * {@inheritdoc} - */ protected function setUp() { parent::setUp(); $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal6.php'); @@ -53,12 +40,12 @@ protected function getEntityCounts() { 'block_content' => 2, 'block_content_type' => 1, 'comment' => 3, - 'comment_type' => 2, + 'comment_type' => 3, 'contact_form' => 5, 'configurable_language' => 5, 'editor' => 2, - 'field_config' => 69, - 'field_storage_config' => 45, + 'field_config' => 73, + 'field_storage_config' => 48, 'file' => 7, 'filter_format' => 7, 'image_style' => 5, @@ -66,7 +53,7 @@ protected function getEntityCounts() { 'migration' => 105, 'node' => 16, 'node_type' => 13, - 'rdf_mapping' => 5, + 'rdf_mapping' => 7, 'search_page' => 2, 'shortcut' => 2, 'shortcut_set' => 1, @@ -80,11 +67,11 @@ protected function getEntityCounts() { 'menu_link_content' => 4, 'view' => 16, 'date_format' => 11, - 'entity_form_display' => 17, + 'entity_form_display' => 19, 'entity_form_mode' => 1, - 'entity_view_display' => 41, + 'entity_view_display' => 43, 'entity_view_mode' => 14, - 'base_field_override' => 37, + 'base_field_override' => 38, ]; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgradeConflicts6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgradeConflicts6Test.php deleted file mode 100644 index 6e1049d..0000000 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgradeConflicts6Test.php +++ /dev/null @@ -1,67 +0,0 @@ -sourceDatabase->getConnectionOptions()['driver']; - $edits = $this->getUiEditsArray(); - - // Ensure submitting the form with invalid database credentials gives us a - // nice warning. - $this->drupalPostForm(NULL, [$driver . '[database]' => 'wrong'] + $edits, t('Review upgrade')); - $this->assertText('Resolve the issue below to continue the upgrade.'); - - $this->drupalPostForm(NULL, $edits, t('Review upgrade')); - $this->assertResponse(200); - $this->assertText('Are you sure?'); - $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data, continue anyway.')); - $this->drupalPostForm(NULL, [], t('Perform upgrade')); - $this->assertText(t('Congratulations, you upgraded Drupal!')); - - $this->runPostMigrationTests(); - } - - /** - * {@inheritdoc} - */ - protected function getEntityCounts() { - $counts = parent::getEntityCounts(); - $counts['comment_type'] = 3; - $counts['field_config'] = 73; - $counts['field_storage_config'] = 48; - $counts['rdf_mapping'] = 7; - $counts['taxonomy_vocabulary'] = 6; - $counts['entity_form_display'] = 19; - $counts['entity_view_display'] = 43; - $counts['base_field_override'] = 38; - return $counts; - } - -} diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php index c7cce81..248213a 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php @@ -45,13 +45,13 @@ protected function getEntityCounts() { 'block_content' => 1, 'block_content_type' => 1, 'comment' => 1, - 'comment_type' => 7, + 'comment_type' => 8, // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'. 'configurable_language' => 4, 'contact_form' => 3, 'editor' => 2, - 'field_config' => 50, - 'field_storage_config' => 38, + 'field_config' => 53, + 'field_storage_config' => 40, 'file' => 3, 'filter_format' => 7, 'image_style' => 6, @@ -59,7 +59,7 @@ protected function getEntityCounts() { 'migration' => 73, 'node' => 3, 'node_type' => 6, - 'rdf_mapping' => 5, + 'rdf_mapping' => 7, 'search_page' => 2, 'shortcut' => 6, 'shortcut_set' => 2, @@ -73,11 +73,11 @@ protected function getEntityCounts() { 'menu_link_content' => 7, 'view' => 16, 'date_format' => 11, - 'entity_form_display' => 16, + 'entity_form_display' => 18, 'entity_form_mode' => 1, - 'entity_view_display' => 27, + 'entity_view_display' => 29, 'entity_view_mode' => 14, - 'base_field_override' => 8, + 'base_field_override' => 9, ]; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgradeConflicts7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgradeConflicts7Test.php deleted file mode 100644 index 612f9c6..0000000 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgradeConflicts7Test.php +++ /dev/null @@ -1,68 +0,0 @@ -sourceDatabase->getConnectionOptions()['driver']; - $edits = $this->getUiEditsArray(); - - // Ensure submitting the form with invalid database credentials gives us a - // nice warning. - $this->drupalPostForm(NULL, [$driver . '[database]' => 'wrong'] + $edits, t('Review upgrade')); - $this->assertText('Resolve the issue below to continue the upgrade.'); - - $this->drupalPostForm(NULL, $edits, t('Review upgrade')); - $this->assertResponse(200); - $this->assertText('Are you sure?'); - $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data, continue anyway.')); - $this->drupalPostForm(NULL, [], t('Perform upgrade')); - $this->assertText(t('Congratulations, you upgraded Drupal!')); - - $this->runPostMigrationTests(); - } - - /** - * {@inheritdoc} - */ - protected function getEntityCounts() { - $counts = parent::getEntityCounts(); - // Forum has a comment. - $counts['comment_type'] = 8; - $counts['field_config'] = 53; - $counts['field_storage_config'] = 40; - $counts['rdf_mapping'] = 7; - $counts['entity_form_display'] = 18; - $counts['entity_view_display'] = 29; - $counts['base_field_override'] = 9; - return $counts; - } - -} diff --git a/core/modules/user/src/Plugin/migrate/destination/EntityUser.php b/core/modules/user/src/Plugin/migrate/destination/EntityUser.php index f0206e5..33d9e54 100644 --- a/core/modules/user/src/Plugin/migrate/destination/EntityUser.php +++ b/core/modules/user/src/Plugin/migrate/destination/EntityUser.php @@ -130,11 +130,11 @@ protected function processStubRow(Row $row) { /** * {@inheritdoc} */ - protected function highestDestinationId() { - $found = parent::highestDestinationId(); + public function getHighestDestinationId() { + $found = parent::getHighestDestinationId(); - // Every Drupal site must have at least a single non-anonymous user, and - // it's normal for upgrade migrations to overwrite this user. + // Every Drupal site must have a user with UID of 1 and it's normal for + // migrations to overwrite this user. if ($found == 1) { return 0; }