Problem/Motivation
Sub-issue for #2746527: [META] Handle data related to Drupal 6 and 7 node translations with different IDs.
When migrating path aliases of translated nodes, some aliases will point to non-existent nodes since source and translations are stored in the same node.
If in D7 we have node/1 as the source in English and node/2 as the French translation, in D8 we will only have node/1. If we had an alias for node/2, it won't work anymore.
Proposed resolution
When migrating path aliases, use the migration process plugin to get the translation source nid and correct the translation path aliases.
Remaining tasks
Write a patch. Write a test. Review.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
maxocub commentedAlmost the same patch as in #2827644: Fix path alias migration of translated nodes [D6].
Comment #3
maxocub commentedFew cosmetic changes.
Comment #4
gábor hojtsyThis indeed is pretty much the same as #2827644: Fix path alias migration of translated nodes [D6]. I updated #2850085: Redirects for translation set migration path in Drupal 6 and 7 to be focused on the redirect then.
Comment #5
alexpottDon't we need to do ensure that the start of the path is node/ because might we otherwise convert an alias like user/1 to something else?
Ah we do that in the destination in \Drupal\path\Plugin\migrate\destination\UrlAlias::import(). So one thing that's obvious is that on a really big site this might lots and lots of lookups for no reason.
There are lots and lots of issues with migrate performance. And this works the same way as the D6 one so I guess this is okay.
Comment #6
alexpottCommitted and pushed 0b45cbb to 8.4.x and c6fe1b2 to 8.3.x. Thanks!
Comment #9
alexpottI added this to 8.3.x because migrate is still in beta and also the changes here are to the template - just leveraging functionality we already have for d6 migration.
Comment #11
maxocub commented