Problem/Motivation

I am using Migrate Drupal UI to migrate from a fairly simple Drupal site, with just some article nodes and some taxonomy terms.

After entering DB details for the D7 site, I get to a page which says:

There is translated content of these types:

content items

It looks like you are migrating translated content from your old site. 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.

But that is not true. My source site does not have translation module enabled, and nodes are only in the default language.

It looks like the warning is shown because the node migrations which the UI sets up are using the node_complete plugin, and it looks like that plugin is chosen over the classic one somewhere in NodeMigrateType::getNodeMigrateType().

Steps to reproduce

Proposed resolution

  • Improve the "There is translated content of these types" alert wording
  • Bypass warning screen if "Content translation" module (translation) is not enabled
  • Document how to automatically bypass warning screen via custom module

See also #3396710: Bypass migration warning 'There is translated content of these types' if Language module is not installed.

Remaining tasks

User interface changes

Before

With a fresh install of the Standard profile (monolingual, no content) I see the following message:

There is translated content of these types:

  • content items

It looks like you are migrating translated content from your old site. 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.

 message with the Standard profile

With a fresh install of the Umami profile (including content in two languages) I see the following message:

There is conflicting content of these types:

  • content blocks
  • files
  • taxonomy terms
  • users

It looks like you have content on your new site which may be overwritten if you continue to run this upgrade. The upgrade should be performed on a clean Drupal 11 installation. For more information see the upgrade handbook.

There is translated content of these types:

  • content items

It looks like you are migrating translated content from your old site. 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.

 message with the Umami profile

After

With a fresh install of the Standard profile (monolingual, no content) I see the following message:

Check whether there is translated content of these types:

  • content items

Possible ID conflicts for translations are not automatically detected in the current version of Drupal. Refer to the Upgrading Drupal handbook for instructions on how to avoid ID conflicts with translated content.

 message with the Standard profile

With a fresh install of the Umami profile (including content in two languages) I see the following messages:

There is conflicting content of these types:

  • content blocks
  • files
  • taxonomy terms
  • users

It looks like you have content on your new site which may be overwritten if you continue to run this upgrade. The upgrade should be performed on a clean Drupal 11 installation. For more information see the upgrade handbook.

Check whether there is translated content of these types:

  • content items

Possible ID conflicts for translations are not automatically detected in the current version of Drupal. Refer to the Upgrading Drupal handbook for instructions on how to avoid ID conflicts with translated content.

 message with the Umami profile

API changes

Data model changes

Release notes snippet

Issue fork drupal-3259581

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

joachim’s picture

Following the code, I don't see how the node_classic migrations can EVER get used:

- CredentialForm::validateForm() calls setupMigrations
- CredentialForm::setupMigrations() calls getMigrations()
- MigrationConfigurationTrait::getMigrations() does:

    $all_migrations = $this->getMigrationPluginManager()->createInstancesByTag($version_tag);

at this point, debugging shows that $all_migrations contains BOTH types of node migrations.

It then does:

    $type = NodeMigrateType::getNodeMigrateType(\Drupal::database(), $drupal_version);

to figure out which type of node migration to use.

However, NodeMigrateType::getNodeMigrateType() doesn't inspect the source DB at all. What it does is:

1. Check a 'migrate_node_migrate_type_classic' (which is undocumented BTW)
2. Check existing migrate tables in the current DB, so that if migrations have already been run, it sticks with the node migration type already used.
3. If neither of those got something, defaults to 'complete'

- Now back in MigrationConfigurationTrait::getMigrations(), the type that was NOT returned from NodeMigrateType::getNodeMigrateType() is filtered out from $all_migrations.

So unless you've set the undocumented setting, or you've already run migrations, it's *impossible* to get the classic migrations.

quietone’s picture

Yes, the classic migration are not to be run from the UI, that is by design. Ideally, the classic node migrations should be deprecated. But that is waiting on #3039240: Create a way to declare a plugin as deprecated.

I agree that "There is translated content of these types:" is not accurate but at least the rest of the message does say that ID conflicts for translations are not detected. I'm pretty sure that warning message is displayed for any destination that is translatable.

This will be fixed when the auditing of translated content, meaning destination for which translation is true, is fixed in #2975518: Add audit of translation content.

I think this can be closed as a duplicate.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

joachim’s picture

That issue has gone nowhere in 2 years.

In the meantime, could the wording be tweaked at least to be less scary?

The code comment says:

        // Translations are not yet supported by the audit system. For now, we
        // only warn the user to be cautious when migrating translated content.
        // I18n support should be added in https://www.drupal.org/node/2905759.

That is far more reasonable -- "We don't audit translations, so we don't know if you have translated content, but if you do, you need to be careful" is much better than saying "It looks like you are migrating translated content from your old site" which in a lot of cases is downright untrue, and therefore confusing and scary.

joachim’s picture

Though I still also wonder whether there is something that can be fixed here.

The message is showing because \Drupal\migrate\Plugin\migrate\destination\EntityContentBase::isTranslationDestination() is finding this in its configuration:

array:3 [▼
  "plugin" => "entity_complete:node"
  "translations" => true
  "default_bundle" => "product_kit"
]

Why is translations TRUE?

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ressa’s picture

I agree @joachim. Getting a false positive is bad UI, and like cookie warnings, quickly clicked by, teaching the user to ignore such warnings.

We risk a "Boy Who Cried Wolf"-situation, where warnings are ignored.

Checking if there actually is translated content in the first place, and don't show it if not is best. But your suggestion to rephrase it is great.

Until the other issue is completed, is there a way to override this warning via a custom module, to set "translations" => false, or some other way to automatically bypass the warning?

ressa’s picture

Status: Active » Needs review
smustgrave’s picture

Title: Migrating from Drupal 7 shows incorrect warning 'There is translated content of these types' » Update migration warning 'There is translated content of these types'
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Scratched the other proposed solutions as this appears to just be updating the text.

Also updated title.

ressa’s picture

Issue summary: View changes

Thanks for a fast review @smustgrave. Do you happen to know if it's hard to bypass the warning via a custom module?

smustgrave’s picture

Maybe a form_alter? Only thing that comes to mind.

ressa’s picture

I patched the migrate_drupal_ui/src/Form/IdConflictForm.php file itself, and check if Language module is installed. If not, it skips over the "There is translated content of these types" prompt screen. It may not be the correct solution, but for now it works well for me, in single language migrations.

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs subsystem maintainer review

There are a couple UI text standards issues with the proposed change set. Added suggestions on the MR.

Once those are addressed, we should also have an additional review from a Migrate subsystem maintainer, especially since @quietone previously stated she considered this wontfix.

ressa’s picture

Issue summary: View changes
Status: Needs work » Needs review

Thanks for the review @xjm, great suggestions which I all accepted.

benjifisher’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs subsystem maintainer review
StatusFileSize
new85.25 KB
new130.22 KB
new83.5 KB
new128.99 KB

@quietone made Comment #3 with the original issue description: just the "Problem/Motivation" section, nothing under "Proposed resolution". I do not think that counts as a vote for "won't fix" updating the UI text.

I reviewed the code changes, including the updated link. (The old link redirects to the new one.) I agree that the change is an improvement.

I tested with and without the proposed changes, starting with fresh installations of the Standard and Umami profiles. I think it is important to look at the case where the is (translated) content that might be overwritten. I am adding screenshots and text to the issue summary, under "User interface changes".

quietone’s picture

@benjifisher, thanks for the thorough testing. This is an improvement that will help the person migrating a sight.

+1 from me too.

xjm’s picture

Nice work everyone. This looks good to me now as well, and the screenshots are definitely helpful.

I rebased the MR to get a fresh test run. Saving credits.

  • xjm committed 194990cb on 11.x
    Issue #3259581 by ressa, xjm, benjifisher, joachim, quietone: Update...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Tests passed. Yay.

Committed to 11.x. I did not backport this to 10.2.x as there are string changes and we're in the release candidate phase for it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.