Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2020 at 09:22 UTC
Updated:
6 Jan 2021 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
quietone commentedAnd a first go at the patch. This adds translations of the main menu in both Icelandic and French for both the label and description and a French translation of the description for the test menu.
Comment #4
quietone commentedForgot to add i18n_menu to the Upgrade7Test.
Comment #6
quietone commentedAdd a menu entity to Upgrade7Test.
Comment #7
quietone commentedTrying to reduce the size of the patch by removing changes to the fixture.
Comment #8
quietone commentedReroll because #3110669: Migrate d7 menu language content settings was committed.
Comment #10
quietone commentedRemove duplicate entry in getMissingPaths().
Comment #11
quietone commentedNow it seems very odd to be adding translations of menus when the d7_menu migration doesn't have a process for the language. This adds such a process to d7_menu.yml and modifies the test to check the language. And MigrateMenuTranslationTest has a spelling correction and adds a test for the fixedlang menu.
Comment #12
quietone commentedNow move source plugin and tests from config_translation to system.
Comment #13
quietone commentedSelf review and found some things to fix. The migration_tag property was missing from the migration. Changed the menu translation source plugin to extend from the menu source plugin and reworked the source plugin methods.
Comment #15
mikelutzThis one looks good to me, I couldn't find any nits
Comment #16
shaktikTest case fails on D9.1, so I am working on it.
Comment #17
shaktikComment #18
shaktikComment #19
shaktikRerolled the patch #13 to made supportable 9.1.x-dev and solved test case issues.
Comment #20
quietone commented@shaktik, thanks for the reroll. Can you please provide a diff between the patches in #13 and #19?
Comment #21
shaktikHi @quietone,
Please find the mention below diff between the patches in #13 and #19
Comment #22
shaktikComment #23
quietone commentedthis is blocking #3008028: Migrate D7 i18n menu links.
Comment #24
mikelutzI'll put this back to RTBC for 9.1, but I wonder if it should be backported and how far. We may want to re-roll for 8.9 and 9.0, as these migrations are important for the ecosystem.
Comment #25
catchfwiw I am +1 to backporting this to 9.0.x and 8.9.x, even in a patch release if that ended up being necessary. Tagging for a second opinion from @xjm though. Haven't reviewed the patch properly yet.
Comment #26
quietone commentedAdded tests for PostgreSQL and SQLlite for the 9.1.x.
Comment #27
quietone commentedLooks like the fixture has changed.
Comment #28
quietone commentedAnd yet another reroll, this time to update the test fixture.
Comment #30
quietone commentedComment #31
quietone commentedAnd a version for 8.9 and 9.0
Comment #32
quietone commentedNice that all the tests are passing but I want to check the migration state file.
Comment #33
quietone commentedThe migration state file is correct. This is ready for review again.
Comment #34
quietone commentedForgot to un-assign myself.
Comment #35
quietone commentedComment #36
quietone commentedComment #37
rajiv.singh commented#31 worked for D8.9 but adding "(en)" in the label of existing menu links during translation

Comment #38
ravi.shankar commentedHere I have added reroll of patch #31.
Comment #40
quietone commented@ravi.shankar, You may not have noticed but there is a 9.1.x patch in #30. The patch in #31 really is just for 8.9.x and 9.0.x. To help reviewers please include an interdiff, or a diff if the interdiff fails, when rerolling patches.
Comment #41
ravi.shankar commentedThanks @quietone
Oh Yes, I didn't notice that there is a patch #30 for Drupal 9.1.x and patch #30 still applies on Drupal 9.1.x.
Please ignore patch #38.
Comment #42
quietone commentedThe reroll here should use the fixture changes from #3110669: Migrate d7 menu language content settings.
Comment #43
quietone commentedRerolling now that #3110669: Migrate d7 menu language content settings is in.
The diff is very large because the patch in #30 included the work from #3110669: Migrate d7 menu language content settings which is no longer needed in the current patch. The only conflicts during the reroll were to the fixture.
Comment #44
quietone commentedThe reroll has been successfull, all tests passing so ready for review.
Comment #45
daffie commentedPatch looks good.
In core/modules/field/src/Plugin/migrate/source/d7/FieldOptionTranslation.php they removed those fields and added them with $query->addField(). Should we do here the same?
Should this field not be in $query->addField()?
Which one is the correct language? It is a bit confusing to me.
Why are we doing the same test twice? Maybe changing one of them to "label" instead of "description".
Comment #46
quietone commented@daffie, thanks for the review.
1. I don't think so. In FieldOptionTranslation.php the alias is needed for 'type' because is exists on the field_config table as well as the 'i18n_string'. There is no 'type' in another table in the query. The alias was added for 'lid' so that the query could be sorted by the 'lid' field, that isn't being done here. A look at some of the other translation source plugins (FieldLabelDescriptionTranslation, BlockCustomTranslation, BlockTranslation) and it seems that FieldOptionTranslation is unique in making aliases for those fields.
2. It isn't there so that 'language' can be used in the migration and not an alias. Is there a better way to do that?
3. The language used for the source id is the language from the table with an alias of 'lt', which is locales_target. The 'alias' property is not uncommon in getIds() and is well documented at \Drupal\migrate\Plugin\MigrateSourceInterface::getIds. Because of that there is no additional comment.
4. Ah, copy/paste error. Fixed.
Added missing field 'language' and 'plural' to \Drupal\system\Plugin\migrate\source\d7\MenuTranslation::fields
Comment #47
daffie commented@quietone: Thanks for your explanation.
All my points are addresed.
All the required testing is in the patch.
All code changes now look good to me.
For me it is RTBC.
Comment #48
quietone commentedDid a self review and noticed that the source plugin Menu.php has been changed but the source plugin test wasn't. This adds a test to the existing MenuTest.php.
Comment #49
quietone commentedForgot to upload the patch.
Comment #50
daffie commentedThe extra testing looks good to me.
Back to RTBC.
Comment #51
quietone commenteds/public static $modules/protected static $modules/
Comment #52
daffie commentedGood change
Comment #53
larowlanComment #54
larowlanCommitted 61ca2c2 and pushed to 9.1.x. Thanks!
Switching to 9.0.x to - this is tagged Needs release manager review for possible backport.
Comment #56
benjifisherThe patch in #51 does not apply to 9.1.x (since it has already been applied) but it also does not apply to 9.0.x. I think we need a reroll, which is a Novice task.
Comment #57
quietone commentedIn order to reroll this the fixture changes from #3110669: Migrate d7 menu language content settings, which did not get committed to 9.0.x, needs to be incorporated. Should we commit that to 9.0.x first or not?
Comment #58
manish-31 commentedAdded a patch for Drupal 9.0.x
Comment #60
quietone commentedSince this needs the fixture changes from #3110669: Migrate d7 menu language content settings and that migration should be ported as well, marking this as postponed.
Comment #61
quietone commentedAdding clarification for the remaining i18n migrations. There are three of these issues that could be backported and they need to be done in this order. One reason is because of the fixture changes.
Comment #63
benjifisherWe decided it is too late to backport #3110669: Migrate d7 menu language content settings, so we will not backport this issue either. Fixed for 9.1.x.