Problem/Motivation
The d7 menu language settings need to be migrated.
Proposed resolution
Use the taxonomy vocabulary language settings migration as a guide for the settings and do the same for menu.
To be sure the new, post revert, patch is working I made some screenshots of 'admin/config/regional/content-language'
Before

After

Remaining tasks
| Comment | File | Size | Author |
|---|---|---|---|
| #80 | 3110669-80.patch | 77.29 KB | quietone |
| #80 | diff-66-80.txt | 893 bytes | quietone |
| #73 | 3110669-73-protected-static-modules.patch | 686 bytes | tr |
| #66 | 3110669-66.patch | 77.34 KB | quietone |
| #66 | interdiff-61-66.txt | 3.63 KB | quietone |
Comments
Comment #2
quietone commentedAnd a patch to start this off.
Comment #4
gábor hojtsyYay thanks for doing this one. Do we really need this much test data updates? :)
Comment #5
quietone commented@Gábor Hojtsy, No, we don't. I still need to trim the dump file.
Comment #6
quietone commentedThis removes unneeded changes to the test fixture and a test for the source plugin. The interdiff failed and a diff was large and well, just noise, so I didn't add it.
Comment #8
quietone commentedLet's fix that test and correct the migration state file.
Comment #10
quietone commentedAnd fixing the entity count
Comment #12
quietone commentedAnd another menu was added.
Comment #13
quietone commentedLet's see if changes to the fixture can be reduced further.
Comment #14
quietone commentedThat's all that I see to remove from the fixture to reduce the size of this patch.
Ready for review.
Comment #15
quietone commentedAdding tags
Comment #16
gábor hojtsyGenerally looks great, thanks! I noticed some leftover things from the base term migration code :) These are all minor.
Hm, its not the taxonomy_vocabulary table though? menu_custom right?
manu?
not terms
Comment #17
quietone commentedFixes for the items in #16.
Comment #18
gábor hojtsyLooks great now, thanks!
Comment #19
quietone commentedThis should be i18n_menu.
This is simple text change, tagging novice.
Comment #20
ravi.shankar commentedHere I have made changes as suggested in comment #19.
Comment #21
heddnRe-rtbcing from #18. The requested changes have landed.
Comment #24
gábor hojtsySuperb, thanks! Next up is #3112249: Migrate d7 menu translation.
Comment #26
quietone commentedWhile working on the other i18n menu issues I can to realize that this patch isn't right. This should be more like the d6 version and simply enable the language content settings for the 'menu_link_content' type. As it is it enables the settings for the menu bundles, but they don't show up in the language settings ui at admin/config/regional/content-language.
I think the migration should be:
Opinions?
Comment #28
catchJust tried to revert this, but the revert is no longer clean against 9.1.x, so this could use a revert patch.
Comment #29
quietone commentedNever made a revert patch before. Let's see how this goes.
Comment #31
quietone commentedHumbug, I somehow missed adding the tests to the patch.
Comment #32
quietone commentedI've checked the revert patch by doing lsdiff on the patches in #20 and #31, both change the same files. And I made a diff as well, it may be of use to a reviewer.
Comment #33
gábor hojtsySpot-checked various points in this patch and it does seem to be rolling back the same things it added indeed.
Comment #34
gábor hojtsyMeant to RTBC it, sorry.
Comment #35
xjm"Rollback" also means a migrate feature, so retitling for clarity.
Comment #38
xjmI reverted the original 8.9.x commit, then committed #31 to 9.0.x and cherry-picked it forward to 9.1.x.
I guess this is then NW for #26?
Comment #39
abhijeet.kumar2107 commentedComment #40
abhijeet.kumar2107 commentedComment #41
abhijeet.kumar2107 commentedComment #42
quietone commentedStart over from the patch based on the patch in #20.
Comment #43
quietone commentedThis needs a 9.0 and 9.1 patch.
I've got before and after screenshot to upload later today.
Comment #44
quietone commentedRemoved unnecessary quotes from the migration yml.
This patch is for 8.9 and 9.0. I can't make one for 9.1.x because this previous version has not been reverted from 9.1.x, even though xjm said it was done in #38
Comment #45
quietone commentedComment #46
xjmIt seems #31 didn't apply to 9.1.x and somehow I didn't notice that the cherry-pick failed. Sorry! So we need a different revert patch for that?
Comment #47
quietone commentedOK. Here is a revert patch for 9.1.x. I haven't run any tests locally.
Comment #49
quietone commentedMissed a change.
Comment #50
quietone commentedI thought it might be useful to have a diff between the revert patch in #31, applied to 8.9 and 9.0, and the patch for 9.1.x in #49. There is one difference, which is that [#3024682 ] was committed on 18 May.
The next thing here is to get the revert patch in #49 to RTBC, and after that make a new patch for 9.1.x.
Comment #51
gábor hojtsyThanks, looks good to me.
Comment #52
quietone commented'Twas in need of another reroll.
Comment #53
catchRe-roll is green.
Comment #55
catchCommitted/pushed to 9.1.x, thanks!
I think that means we go back to 'needs work' here.
Comment #56
catchComment #57
quietone commentedNow for the corrected patch. The latest correct patch, post revert is in 43 which is in #44.
Moving back to migration system because the the migrate maintainers use that component to find the issues to review. If there is a desire to move issues to modules the idea can be brought to a migrate meeting.
Comment #59
quietone commentedFixing the 9.1.x version of the patch
Comment #60
quietone commentedThere are now patches for 8.9, 9.0 (both in#57 and 9.1 in #59. There is nothing in the patch that should cause a failure on PostgresSQL but I tested it anyway. Or should I say eventually, I kept clicking the wrong test and version (plus the mouse battery was low and it has a mind of its own) but got there eventually.
Comment #61
quietone commentedNeeded a reroll. and now a separate patch for 9.1.x.
Comment #62
jibranJust on suggestion.
Why are not using default value plugin here? tracking down constants is difficult to debug imo.
Comment #63
quietone commentedFor consistently with d6_language_content_menu_settings.yml and other d*_language_content_*_settings.yml. Also, these are small yml files and the constants are defined in the 'source:' a few lines above so shouldn't be hard to track down.
Comment #64
quietone commentedAdd d6 menu link migration as a related issue.
Comment #65
daffie commentedThe patch looks good to me. Only I do have some questions:
Can we just remove the variable $target_entity.
Why do you set the value to '5' in this case, where all other values are set to '0'? When I do a code base search, I find possible values of 0, 1, 2 and 4, but not 5.
Is there a standard for adding quoting values. In this yml file and others is it not done and in others it is done. Not sure what to do or are both allowed?
Can you explain why this change is needed?
Can you explain why these changes are needed?
Why is these menu items removed?
The same for this change: why is this done?
Comment #66
quietone commented65.1 Fixed
65.2 The 5 is I18N_MODE_MULTIPLE, defined in 18n.module.
65.3 YAML does not require quotes for scalars so I prefer not to use them. Drupal does not have a standard about quotes in yaml.
65.4 -> 64.7. When I make changes to the fixture I normally do it by bringing up a d6 or d7 site and make the changes via the UI to make sure they are correct. That leads to all kinds of changes in the fixture that I need to make sure are not in the patch and sometimes I miss changes. I have removed the ones you identified.
Comment #67
quietone commentedComment #68
daffie commented@quietone: Thank you for the explanations.
All the code changes now look good to me.
It is for me RTBC.
Comment #69
alexpottCommitted e72c88f and pushed to 9.1.x. Thanks!
Comment #71
quietone commented@alexpott, Thanks!
Comment #72
quietone commentedJust tidying up the related issues and fixing that parent issue.
Comment #73
tr commentedThe commit in #70 introduced a regression - it uses
public static $modulesin the test instead ofprotected static $modules.It's a quick fix - can this be fixed here, or should I open a new issue?
Comment #74
daffie commented@TR: I think that it is better to open a new issue and link it to this issue as a followup.
Comment #75
tr commentedMmm, OK, I posted the fixes in #3164721: More uses of public static $modules. Maybe you can review that @daffie?
Comment #77
quietone commentedOver in #3112249: Migrate d7 menu translation larowlan asks if that issue should be backported to 9.0.x. If that is to be done it would be easier if this was ported first because this contains needed fixture changes.
Comment #78
mikelutzLeaving this for RM review on whether we can back-port to 9.0
Comment #79
benjifisherShould the status be "Patch (to be ported)"?
I am changing the target branch to 9.0.x.
Comment #80
quietone commentedLet's get a working patch for 9.0.x
Comment #81
mikelutzThank you, @quietone! To recap for the RMs: This patch contains a new migration for the menu language content settings, a bunch of tests, and updates to the fixture. While not technically a bug fix, and would ordinarily not be eligible for a backport to 9.0, the new migration enhances support for D7 migrations, which we've traditionally considered backports for as its good for the ecosystem to make it as easy as possible to get people off of D7 into modern Drupal. Also, the fixture changes are needed to backport #3112249: Migrate d7 menu translation, which contains another needed D7 i18n migration, which is being considered for backport. None of this is runtime code, so from that perspective, it is safe to backport, but this and the other issue will help make it easier for people to run migrations from D7 to D9.0 right now, so I'm in favor of the backport to 9.0 and 8.9, but leaving it to @xjm and @catch to approve or deny. If this is approved and committed, We would then put the other issue up for backport as well, so a up/down on both would be great.
Originally this was committed to 9.0 (When that was the active dev branch) and backported to 8.9 (again while that was still in -dev). It had to be reverted due to a regression that has been fixed, so we need a new determination from the RMs as to whether it still qualifies for backport and how far back it should be backported.
Comment #82
mikelutzComment #83
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 #84
wim leers9.1.0 was released nine days ago. I don't think backporting is still relevant?
Comment #86
catchYes moving this back to 'fixed' on 9.1.x
Comment #87
benjifisherThen let's also remove "[backport]" from the title.