#239 | interdiff.txt | 2.08 KB | quietone |
#239 | 2225681-239.patch | 11.89 KB | quietone |
|
#234 | 2225681-233.patch | 11.61 KB | quietone |
|
#234 | interdiff.txt | 2.58 KB | quietone |
#225 | 2225681-225.patch | 11.08 KB | quietone |
|
#225 | interdiff.txt | 640 bytes | quietone |
#223 | interdiff.txt | 1.97 KB | quietone |
#223 | 2225681-223.patch | 11.1 KB | quietone |
|
#217 | 2225681-217.patch | 11.23 KB | jofitz |
|
#217 | interdiff-215-217.txt | 636 bytes | jofitz |
#215 | 2225681-215.patch | 11.34 KB | quietone |
|
#215 | interdiff.txt | 1.13 KB | quietone |
#213 | 2225681-213.patch | 11.29 KB | quietone |
|
#209 | interdiff.txt | 2.43 KB | quietone |
#209 | 2225681-209.patch | 11.27 KB | quietone |
|
#207 | 2225681-207.patch | 13.1 KB | quietone |
|
#207 | interdiff.txt | 898 bytes | quietone |
#205 | interdiff-204-205.txt | 7.79 KB | quietone |
#205 | interdiff-fail.patch | 776 bytes | quietone |
|
#205 | 2225681-205-fail.patch | 12.59 KB | quietone |
|
#205 | 2225681-205.patch | 12.6 KB | quietone |
|
#204 | interdiff.txt | 898 bytes | quietone |
#204 | 2225681-204.patch | 18.1 KB | quietone |
|
#201 | interdiff-198-201.txt | 1.03 KB | quietone |
#201 | interdiff-fail.txt | 776 bytes | quietone |
#201 | 2225681-201-fail.patch | 17.6 KB | quietone |
|
#201 | 2225681-201.patch | 17.6 KB | quietone |
|
#198 | 2225681-198.patch | 18.26 KB | quietone |
|
#196 | 2225681-196.patch | 18.52 KB | quietone |
|
#194 | 2225681-194.patch | 18.04 KB | yogeshmpawar |
|
#185 | interdiff.txt | 1.92 KB | quietone |
#185 | 2225681-185.patch | 18.19 KB | quietone |
|
#183 | interdiff.txt | 525 bytes | quietone |
#183 | 2225681-183.patch | 18.19 KB | quietone |
|
#181 | interdiff.txt | 506 bytes | quietone |
#181 | 2225681-181.patch | 18.18 KB | quietone |
|
#179 | 2225681-179.patch | 18.12 KB | jofitz |
|
#179 | interdiff-176-179.txt | 2.55 KB | jofitz |
#176 | interdiff.txt | 8.7 KB | quietone |
#176 | 2225681-176.patch | 16.83 KB | quietone |
|
#176 | 2225681-fail-176.patch | 16.83 KB | quietone |
|
#174 | interdiff.txt | 623 bytes | quietone |
#174 | 2225681-174.patch | 10.29 KB | quietone |
|
#172 | interdiff.txt | 968 bytes | quietone |
#172 | 2225681-172.patch | 9.48 KB | quietone |
|
#165 | interdiff.txt | 583 bytes | quietone |
#165 | 2225681-165.patch | 9.46 KB | quietone |
|
#163 | interdiff-2225681-161-163.txt | 333 bytes | RytoEX |
#163 | interdiff-2225681-146-163.txt | 353 bytes | RytoEX |
#163 | 2225681-163.patch | 8.72 KB | RytoEX |
|
#161 | interdiff-2225681-146-161.txt | 351 bytes | RytoEX |
#161 | 2225681-161.patch | 8.71 KB | RytoEX |
|
#146 | interdiff-143-146.txt | 1.35 KB | jofitz |
#146 | interdiff-139-146.txt | 915 bytes | jofitz |
#146 | 2225681-146.patch | 8.71 KB | jofitz |
|
#143 | interdiff-139-143.txt | 2.32 KB | jofitz |
#143 | 2225681-143.patch | 8.71 KB | jofitz |
|
#139 | interdiff.txt | 1.27 KB | quietone |
#139 | 2225681-139.patch | 8.73 KB | quietone |
|
#139 | interdiff.txt | 2.93 KB | quietone |
#139 | 2225681-138.patch | 8.73 KB | quietone |
|
#136 | interdiff-131-136.txt | 12.42 KB | jofitz |
#136 | 2225681-136.patch | 8.39 KB | jofitz |
|
#131 | interdiff-124-129.txt | 758 bytes | dipakmdhrm |
#131 | 2225681-129.patch | 8.69 KB | dipakmdhrm |
|
#128 | interdiff-124-128.diff | 758 bytes | dipakmdhrm |
|
#128 | 2225681-128.patch | 16.39 KB | dipakmdhrm |
|
#124 | interdiff-119-124.txt | 4.21 KB | jofitz |
#124 | 2225681-124.patch | 8.69 KB | jofitz |
|
#119 | interdiff-2225681-114-119.txt | 1.04 KB | dipakmdhrm |
#119 | 2225681-119.patch | 9.88 KB | dipakmdhrm |
|
#114 | 2225681-114.patch | 9.89 KB | jofitz |
|
#114 | interdiff-110-114.txt | 1.25 KB | jofitz |
#110 | 2225681-110.patch | 10.16 KB | jofitz |
|
#108 | 2225681-108.patch | 10.16 KB | jofitz |
|
#106 | 2225681-106.patch | 10.34 KB | jofitz |
|
#106 | interdiff-104-106.txt | 16.04 KB | jofitz |
#104 | 2225681-104.patch | 10.45 KB | maxocub |
|
#103 | interdiff-101-103.txt | 1.32 KB | jofitz |
#103 | 2225681-103.patch | 22.41 KB | jofitz |
|
#101 | interdiff.txt | 1.13 KB | quietone |
#101 | 2225681-101.patch | 22.53 KB | quietone |
|
#99 | interdiff.txt | 1.88 KB | quietone |
#99 | 2225681-99.patch | 22.5 KB | quietone |
|
#86 | interdiff-83-86.txt | 789 bytes | jofitz |
#86 | 2225681-86.patch | 23.51 KB | jofitz |
|
#83 | interdiff.txt | 8.93 KB | quietone |
#83 | migrate_d6_i18n_blocks-2225681-83.patch | 23.55 KB | quietone |
|
#81 | interdiff.txt | 12.7 KB | quietone |
#81 | migrate_d6_i18n_blocks-2225681-81.patch | 24.01 KB | quietone |
|
#72 | interdiff.txt | 810 bytes | quietone |
#72 | migrate_d6_i18n_blocks-2225681-72.patch | 22.07 KB | quietone |
|
#70 | interdiff.txt | 35.06 KB | quietone |
#70 | migrate_d6_i18n_blocks-2225681-70.patch | 22.05 KB | quietone |
|
#65 | interdiff.txt | 1.37 KB | quietone |
#65 | migrate_d6_i18n_blocks-2225681-65.patch | 21.77 KB | quietone |
|
#63 | interdiff.txt | 1023 bytes | quietone |
#63 | migrate_d6_i18n_blocks-2225681-63.patch | 21.13 KB | quietone |
|
#61 | interdiff.txt | 37.5 KB | quietone |
#61 | migrate_d6_i18n_blocks-2225681-61.patch | 21.12 KB | quietone |
|
#59 | interdiff.txt | 1.26 KB | quietone |
#59 | migrate_d6_i18n_blocks-2225681-59.patch | 38.38 KB | quietone |
|
#57 | interdiff.txt | 4.64 KB | quietone |
#57 | migrate_d6_i18n_blocks-2225681-57.patch | 38.38 KB | quietone |
|
#54 | migrate_d6_i18n_blocks-2225681-54.patch | 38.55 KB | quietone |
|
#49 | interdiff.txt | 18.23 KB | quietone |
#49 | migrate_d6_i18n_blocks-2225681-49.patch | 45.26 KB | quietone |
|
#47 | interdiff.txt | 2.38 KB | quietone |
#47 | migrate_d6_i18n_blocks-2225681-47.patch | 44.84 KB | quietone |
|
#43 | migrate_d6_i18n_blocks-2225681-40.patch | 46.36 KB | Ada Hernandez |
|
#39 | migrate_d6_i18n_blocks-2225681-39.patch | 46.36 KB | Ada Hernandez |
|
#39 | interdiff.txt | 7.73 KB | Ada Hernandez |
#35 | 2225681-35.patch | 44.52 KB | jofitz |
|
#35 | interdiff.txt | 717 bytes | jofitz |
#33 | 2225681-33.patch | 43.82 KB | jofitz |
|
#33 | interdiff.txt | 714 bytes | jofitz |
#29 | 2225681-29.patch | 49.41 KB | jofitz |
|
#29 | interdiff.txt | 714 bytes | jofitz |
#27 | 2225681-27.patch | 43.53 KB | jofitz |
|
#27 | interdiff.txt | 1.19 KB | jofitz |
#25 | 2225681-25.patch | 42.85 KB | jofitz |
|
#18 | 2225681-18.patch | 46.79 KB | quietone |
|
#14 | interdiff-2225681-12-14.txt | 643 bytes | quietone |
#14 | 2225681-14.patch | 46.83 KB | quietone |
|
#12 | interdiff-2225681-10-12.txt | 972 bytes | quietone |
#12 | 2225681-12.patch | 46.84 KB | quietone |
|
#10 | interdiff-2225681-8-10.txt | 14.92 KB | quietone |
#10 | 2225681-10.patch | 46.84 KB | quietone |
|
#8 | 2225681-8.patch | 34.22 KB | quietone |
|
#6 | 2225681-6.patch | 6.06 KB | quietone |
|
#40 | interdiff-34-40.txt | 1.03 KB | Ada Hernandez |
#40 | migrate_d6_i18n_blocks-2225681-40.patch | 46.36 KB | Ada Hernandez |
|
Comments
Comment #1
pcambraComment #2
phenaproximaComment #3
phenaproximaBlocked by #2594263: Add translation data to Migrate Drupal's test fixtures.
Comment #4
svendecabooterUnblocked
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedComment #6
quietone CreditAttribution: quietone as a volunteer commentedJust a beginning. This migrates the block title from the i18n_strings table.
Needs the source data from #2670170: Add i18n string & variable data to d6_dump and destination plugins in #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedConsider this a first draft. It does migrate the translations for the title and the block content, using the existing block migrations as models. It may not be the best or most efficient method.
Comment #10
quietone CreditAttribution: quietone as a volunteer commentedForgot to add language manager to the other destination entities.
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedHave no idea why $language_manager was private. Especially when tests are passing locally.
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedFix class name.
Comment #15
quietone CreditAttribution: quietone as a volunteer commentedLet's test this.
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedReroll, and the interdiff fails.
Comment #20
Gábor HojtsyThanks for working on this :)
Why do comments need to change here?
Unfortunately the migration system was rearchitected to not use migration templates anymore, this needs to be modified.
Are we supposed to only support a fixed set of blocks? :/ Can we take these from the existing block migration or do we need to list them again?
This change is already made in #2225775: Migrate Drupal 6 core node translation to Drupal 8 or at least similar :)
Comment #21
Gábor Hojtsy@quietone: are you still working on this?
Comment #23
iMiksuNeeds also an reroll against 8.2.x.
Comment #24
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedGave it a go at the reroll, but failed miserably... this isn't a reroll someone without good knowledge of the latest changes and what this patch is trying to achieve can do, meaning to say the reroll will have to make some changes to the original patch was doing because of what is in core nowadays.
Comment #25
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-roll.
Comment #27
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #29
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #31
jofitz CreditAttribution: jofitz at ComputerMinds commentedUpdated version to 8.3.x.
Comment #33
jofitz CreditAttribution: jofitz at ComputerMinds commentedWell this is just getting embarrassing...
Comment #35
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #36
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedAwesome @Jo Fitzgerald thanks for working on this!
Comment #37
iMiksuI was checking some coding and comment standards out of this. All of this should be novice.
Use short array syntax.
Use short array syntax
Unnecessary extra newline. Shouldn't have any. See "Plugin discovery annotations" from comment standards.
Needs a blank line between
use
declarations and comment block. See "Identing" from coding standards.Use short array syntax.
Use short array syntax here and check indenting that it closes in its own line.
Needs a blank line.
Use short array syntax.
Use short array syntax
Double comment block starting.
Comment #38
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedWorking in this now!
Comment #39
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedthe new changes for standard commentaries and arrays were added.
Comment #40
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedI have removed extra indents
Comment #41
iMiksuComment #42
quietone CreditAttribution: quietone as a volunteer commentedSince this issue began the Substr process has been added to core. So this can be removed.
Comment #43
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentednow the
core/modules/config_translation/src/Plugin/migrate/process/Substr.php
was removed.Comment #44
quietone CreditAttribution: quietone as a volunteer commentedThis and a couple of other i18n issues that make changes to EntityConfigBase destintations. Of those I believe #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields has received the most feedback from Gábor Hojtsy and a review from phenaproxima (who has asked for a test for the changes to the destination).
Therefor, I am marking this as Postponed, until the destination is finalized in #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields.
Comment #45
Gábor HojtsyYeah it would be important to commit this at one place instead of working on the same thing in parallel, thanks @quietone, was about to say the same :)
Comment #46
quietone CreditAttribution: quietone as a volunteer commented#2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields is in so no longer postponed.
Comment #47
quietone CreditAttribution: quietone as a volunteer commentedRemoved core/modules/config_translation/src/Plugin/migrate/process/Substr.php.
Comment #48
quietone CreditAttribution: quietone as a volunteer commentedOh silly me, i18n user profile isn't in. It is just RBTC.
Comment #49
quietone CreditAttribution: quietone as a volunteer commentedStill, I did some cleanup and converted I18nBoxTest and I18nBockSourceTest from MigrateSqlSourceTestCase to MigrateSqlSourceTestBase.
Comment #50
Gábor HojtsyYay, thanks! Let's hope the dependency lands soon.
Comment #52
DamienMcKennaCross-referencing the issue that's blocking this one.
Comment #53
quietone CreditAttribution: quietone as a volunteer commented#2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields is in, no loner postponed.
Comment #54
quietone CreditAttribution: quietone as a volunteer commentedreroll
Comment #56
Gábor HojtsyThanks, here is an initial review:
Why do we need to make these changes to comments, users, etc?
Minor: too much whitespace.
No locale needed here I believe.
Also why do we need all of views, comment and menu UI as well?
This is for custom content blocks, that would be a better explanation IMHO, not just bodies, they also have titles.
I am not sure we need locale module for this one? Do we?
source should be i18n module (or i18nstrings or the respective i18n module) IMHO
Also finally the issue summary needs updating to explain how this covers both custom blocks (title/body) and arbitrary blocks (title).
Comment #57
quietone CreditAttribution: quietone as a volunteer commentedFixes for everything in #56.
As for the issue summary update, I think this only covers custom blocks title and body. Adding a translation for the title on the navigation block created content in the
i18n_block
table, which is not used in the source plugins here. If I am correct then the various changes here should be renamed by adding 'custom' to the names. And then, the new migration for block titles would use d6_i18n_block. Do I have that right?Comment #59
quietone CreditAttribution: quietone as a volunteer commentedFix namespace errors.
Comment #60
Gábor HojtsyYeah in Drupal 6 these are called boxes, in Drupal 8 they are block_content. Depending on what naming convention would the migration use, we should name them after that version's name. I think box.
Comment #61
quietone CreditAttribution: quietone as a volunteer commentedOK. I took a fresh look at these block translations. Also, a good idea because the first patch I made for this was 11 months ago when I knew a lot less about migration. Not that there isn't much more to learn.
What needs to happen is migrate the block title field and the custom block title and body fields. The source tables for these are:
Blocks - 'blocks' and 'i18n_block'.
Custom blocks - 'boxes' and 'i18n_strings'.
If that is correct the rest is simpler. The source plugins are d6_i18n_block and d6_i18n_box, matching the existing d6_block and d6_box. There is no need to change any destinations, so that has been removed. And everything is in content_translation.
Probably a good idea to ignore the interdiff, it is larger than the patch.
Comment #63
quietone CreditAttribution: quietone as a volunteer commentedSome of those errors are in tests unrelated to the patch and there is "The /var/www/html/core/modules/content_translation/migration_templates/d6_i18n_block.yml contains invalid YAML". Which it doesn't or the tests would not pass locally, so maybe the patch was corrupted?
Anyway, found a space error and a namespace error.
Comment #65
quietone CreditAttribution: quietone as a volunteer commentedYes, there really was an error in the d6_i18n_block.yml file but it didn't stop the local tests from passing.
This fixes the yml file and also changes it to use the migration process plugin to get the id. It seems better to do it this way since the d6_block migration uses dedupe on the id. Other i18n migration might need to do this as well. Also, fixed
MigrateBlockTest since the source not includes a translation of the title.
Comment #66
Gábor HojtsyAssigning for review.
Comment #67
Gábor HojtsyI think this looks generally good but it would be really nice to clean up some class naming and docs because its confusing which class/migration/test does what.
Its hard to tell which specific things do these migrations support, can we be more specific?
Cleaner / more similarly structured (data vs. translation for example) descriptions would be nice to make it easier to tell which one is which one.
Minor: ..
Maybe: "An array of result rows with the info keys merged in to (...)"
Cleaner description of which one is doing what would be useful.
It says block content test, but it tests the title translation, this is confusing :/
The descriptions are the same but the functionality is different.
Also I think similarly to other i18n migrations, this does not ensure the block fields themselves are marked translatable (for UI purposes). While translating the content on the API works without that, users will not be able to change or add new translations. Not 100% sure if we should do that here or not, but it needs to get done somewhere :)
Comment #68
quietone CreditAttribution: quietone as a volunteer commentedComment #69
quietone CreditAttribution: quietone as a volunteer commentedThis also needs renaming. The migrations be in the form basicmigration_variation. The same pattern should be used for the related files like migration plugins and tests. See #26 and #27
Comment #70
quietone CreditAttribution: quietone as a volunteer commentedFirst, rename migrations to use _translation as per #69.
Still need to do everything in #67.
Comment #72
quietone CreditAttribution: quietone as a volunteer commentedMade the corrections in MigrateUpgradeForm. I think I will throw a party when #2569805: For Drupal migration, identify the source module is Fixed.
Comment #73
quietone CreditAttribution: quietone as a volunteer commentedLet's do that here.
The source plugin BoxTranslation uses the same method as a version of menu link translation source plugin that alexpott kicked back with concerns about the scalability. See #39 of that issue.
Comment #74
quietone CreditAttribution: quietone as a volunteer commentedComment #76
quietone CreditAttribution: quietone as a volunteer commentedBack to Needs work to rework the source plugin.
Comment #77
quietone CreditAttribution: quietone as a volunteer commentedPostponing this because the source plugin test is returning false positives. #2862006: MigrateSourceTestBase returns false positives for most plugin tests
Comment #78
heddnComment #79
jofitz CreditAttribution: jofitz at ComputerMinds commentedNo longer blocked.
Comment #80
heddnBumping priority while triaging the queue in the weekly migrate meeting. Getting this done is blocking completion of d6 migration path.
Comment #81
quietone CreditAttribution: quietone as a volunteer commentedReworked the source plugin.
Comment #83
quietone CreditAttribution: quietone as a volunteer commentedUpdate the source plugin test and the migration to suit the new source plugin.
Comment #84
quietone CreditAttribution: quietone as a volunteer commentedNeed to rename the migration as per #2861383: Rename i18n migrations to _translation.
Comment #85
quietone CreditAttribution: quietone as a volunteer commentedAh, silly me, the renaming is already done, in #70.
Comment #86
jofitz CreditAttribution: jofitz at ComputerMinds commentedRemoved redundant (debugging?) line that was highlighted as a coding standards infringement.
Comment #87
maxocub CreditAttribution: maxocub commentedAssigning for review
Comment #88
maxocub CreditAttribution: maxocub commentedThis is not a full review, I'm just trying to understand the scope of the issue since the IS seems to be outdated.
I'm have no experience with the D6 i18n module, but if I understand correctly, if you select a language for a block, the block will only appear if you are viewing the site in the selected language. Maybe this is not the scope of this issue, but I don't see this behavior being migrated here.
This block is supposed to be only displayed when the site is in Zulu, so the $visibility settings should not be empty.
This should provide a process pipeline for the visibility settings.
Comment #89
quietone CreditAttribution: quietone as a volunteer commented@maxocub, thanks for the review. I've been learning D6 internationalization as I work on these issues so don't have much experience.
I'll try to explain what happens when I translate a block, in this case the navigation block. On the block config page, I can choose a language for the block and the various visibility settings. If say, I choose Zulu, the label field in the blocks table is overwritten with the Zulu title and so are the visibility settings. If I then choose French, the French title and visibility settings overwrites the Zulu versions and the block can only be for French. It seems that the block can only be in one language (or all languages). The block migration will migrate the possibly translated title and the visibility settings. Then d6_block_translation, will make sure the title has the correct language code.
Make sense?
Comment #90
maxocub CreditAttribution: maxocub commented@quietone: I think I understand what you're doing, that is migrating the string translations of the block labels?
What I understood and what I tried was:
1) Fresh D6 install
2) Enable i18nblocks
3) Add a language, say French
4) Enable path prefix for language selection
5) Go to the Blocks page
6) Configure a block, say Navigation
7) Chose French in the languages selection
8) Now, if you are seeing the site in English, you don't see the Navigation block, but if you see it in French (/fr) you see it.
9) Then if you migrate, on the D8 site the Navigation block is visible on both English and French, which is not the same behavior as on the D6 site.
If on the D8 site I configure the Main Navigation block and select French, then the visibility configuration of the block will be:
But in the above migration scenario, the visibility configuration of the block is empty.
Am I thinking out of the scope of this issue?
Comment #91
quietone CreditAttribution: quietone as a volunteer commented@maxocub, thanks! Now I understand the problem.
I think we should move visibility to a follow up. Even if we make the changes to migrate the visibility settings of a translated block the visibility settings for the non-translated block will be incorrect. And It doesn't seem obvious how to solve this. At least to me. Because, if I understand correctly, when migrating a french language navigation block, we also have to modify the visibility settings on the english version navigation block.
And, In favour of a followup is that this does migrate the translation and the user can fix this visibility in the UI.
So, yes, let's move migrating visibility settings on i18n blocks to a follow up.
Comment #93
maxocub CreditAttribution: maxocub commentedPicking up for review
Comment #94
maxocub CreditAttribution: maxocub commentedI'd like to see an issue summary update here, to make it easier for reviewers and eventually commiters.
Comment #95
quietone CreditAttribution: quietone as a volunteer commentedhad a go at updating the IS.
A follow up has been created as discussed in #90, #91. #2903579: Migrate translated block visibility settings
Comment #96
maxocub CreditAttribution: maxocub commentedThanks @quietone!
Assigned for review.
Comment #97
maxocub CreditAttribution: maxocub commented1.
Why do we put this in content_translation and not block and block content? Like d6_node_translation being in the node module?
2.
This is not needed.
3.
Instead of creating each languages, we can just add 'language' to the executed migrations.
4.
I'm not certain if it would accelerate this issue getting in, but personnaly I would have find a lot easier to understand this patch if it was split in two, one for block translation ans one for custom block translation.
Comment #98
maxocub CreditAttribution: maxocub commentedOh, and it needs a re-roll, simply needs to remove the changes in MigrateUpgradeForm.php
Comment #99
quietone CreditAttribution: quietone as a volunteer commentedJust the reroll.
Comment #101
quietone CreditAttribution: quietone as a volunteer commentedNeeded to add the source_module to the source plugin annotations. Hopefully that will fix the tests and complete the reroll.
Comment #103
jofitz CreditAttribution: jofitz at ComputerMinds commentedChanged the source module for BoxTranslation.
Removed the redundant migrations from MigrateCustomBlockContentTranslationTest (#97.2).
Comment #104
maxocub CreditAttribution: maxocub commentedOk, so I took the liberty to split this patch in two for easier reviews & commit, one problem/solution per issue. This one now deals with block translated string migration, and the other one, #2909444: Migrate D6 i18n custom blocks (boxes), deals with custom blocks (boxes) translations migration.
No change has been made to the remaining code.
Comment #105
maxocub CreditAttribution: maxocub commented1.
Nit: Block translations?
2.
These can be chained.
3.
I'm not sure that content_translation is the right place for this code. I think it should go in block, like the node translation migrations are in the node module.
4.
This comment needs to be updated.
Comment #106
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #108
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #110
jofitz CreditAttribution: jofitz at ComputerMinds commentedPut d6_block_translation source plugin in a d6 sub-directory.
Comment #112
maxocub CreditAttribution: maxocub commentedWe are putting this in the d6 namespace and we are checking if we are dealing with D6 or D7. We should do one or the other. I think this source plugin should also work with D7, but we should confirm that before.
The namespace doesn't match the file location. This will depend on where we put the source plugin.
Comment #113
maxocub CreditAttribution: maxocub as a volunteer and commentedRe #112:
i18n_blocks
table in D7, the translations are stored ini18n_string
. So the plugin should stay in the d6 namespace but we should remove thegetModuleSchemaVersion()
call and just hardcode the blocks table name.BlockTranslationTest
in a d6 folder to match the namespace. This should fix the failing test.Comment #114
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #115
maxocub CreditAttribution: maxocub for Acquia commentedEvery concerns have been addressed, I think this is ready to be RTBCed.
Comment #116
quietone CreditAttribution: quietone as a volunteer commented@Jo Fitzgerald and @maxocub thanks for getting this to RTBC. Wanting to get this done in Vienna. And you all did it!
Comment #117
phenaproximaThis patch looks very, very good overall. So nice and clear, and good test coverage. I did find a few concerns, though.
This needs to be i18n_block, or whichever module it is that actually creates the i18n_blocks table. Pretty sure it ain't the block module, though. =\
Nit: Let's take module and delta out of the call to fields(), since we're including them again in the addField() calls.
I don't understand why these changed, in this test.
Why this change in the block table? That seems incorrect.
Comment #118
quietone CreditAttribution: quietone as a volunteer commented#117.4) I was originally surprised when learning about translated blocks how the data is stored in the block table. When making changes to the source db, I use the UI and watch what happens to the database tables. When adding the Zulu translation the translation was put in a row in the block table. This change reflects that.
#117.3) The translation was updated so, update the test string. I think the visibility can be restored to the original, there is a follow up issue for visibility settings.
Comment #119
dipakmdhrm CreditAttribution: dipakmdhrm as a volunteer commentedThis fixes Observion #1 & #2 from comment #117.
However, #3 & #4 are a little tricky.
If we change the Block title in the fixture from empty value to a string. Tests in
MigrateBlockTest.php
expect the label to be visible. Don't know why... I am hoping that the answer is "Blocks are weird"....And thus if we have a non-empty title for the block in fixture, we need the test to expect the lable to be visible. ¯\_(ツ)_/¯
Comment #120
dipakmdhrm CreditAttribution: dipakmdhrm as a volunteer commentedForgot to put this in review.... :(
Comment #121
quietone CreditAttribution: quietone as a volunteer commentedRegrarding #117.3) There has been some discussion and questioning the change to 'label_display' in the test. That setting is migrated in d6_block, specifically the process plugin block_settings. In that process, if the title field is populated in the d6 source then the label_display will be 'visible'. The relevant code is:
So, the change to the test is correct.
Comment #123
phenaproximaIs there any reason this class could not extend the Block source plugin, and add i18n stuff to query()? This would reduce the amount of code we need here...
If we make BlockTranslation extend Block, this test could maybe extend Block's test too.
Comment #124
jofitz CreditAttribution: jofitz at ComputerMinds commented@phenaproxima I have made the changes you suggested, but I'm not entirely convinced of the benefits - can you persuade me?
Comment #125
quietone CreditAttribution: quietone as a volunteer commented@Jo Fitzgerald, thanks! I was working on this but then webchick came by to do some commits.
Comment #127
jofitz CreditAttribution: jofitz at ComputerMinds commentedAww, I screwed that up, didn't I! @quietone Feel free to take over, I'm calling it a day and going home for the weekend!
Comment #128
dipakmdhrm CreditAttribution: dipakmdhrm as a volunteer commentedquiteone's original patch had a query in
BlockTranslation
class that did a left join fromi18n_blocks
table toblocks
table to get all the translated blocks.jo-fitzgerald's patch in #128 made a change to base
BlockTranslation
onBlock
, but this changed the query and the new query had a left joind fromblocks
table toi18n_blocks
table which resulted in null values for some blocks.I've updated the code to do an
innerJoin
betweenblocks
&i18n_blocks
to get only the required translated blocks.Comment #131
dipakmdhrm CreditAttribution: dipakmdhrm as a volunteer commentedPatch in 128 failed to apply because I created the patch on 8.5.x version and somehow managed to get unwanted code in the diff.
Patch in 128 should be completely disregarded.
Changing patch to 8.4.x.
Changes mentioned in 128 still apply though.
Comment #132
dipakmdhrm CreditAttribution: dipakmdhrm as a volunteer commentedComment #133
quietone CreditAttribution: quietone as a volunteer commentedOne more thing! I think that the intent of #123.2, extending the source plugin test, hasn't been addressed.
This is the first time, that I can think of, that a source plugin test extends from the parent. That is ok, but this is not clear at all what is the difference between this test and the parent test. And looking at the parent it seems that currently every array in $tests is overwritten, which means this line is not doing anything except confusing the reader. How about we keep this line but just change those array values that are different. That has the advantage that we can quickly see the necessary changes for this test.
Comment #134
quietone CreditAttribution: quietone as a volunteer commentedFrom #105.3,
This has been niggling at me for a while. And now back at home it is clear to me why I put in content_translation.
The node translation migrations can be in the node module because it uses the same source plugin as non-translated node. But for blocks, a new source plugin is needed because both the block table and the i18n_blocks table are required.
When block is enabled on the destination site this block translation migration will be discovered but the source site may not have translations. Without the existence of all the source tables the migration will generate an error about 'base table or view not found'. And for those with a single language site this will be confusing and just plain wrong. This can be avoided by moving the block translation code to content_translation. That way the block translation migration is only discovered when content_translation is enabled, which is needs to be to translate blocks.
Therefor this should be moved back to content_translations.
Comment #135
maxocub CreditAttribution: maxocub as a volunteer commented@quietone: Thanks for the clarification, I had not realized that, so I agree that this should go in content_trnaslation.
Comment #136
jofitz CreditAttribution: jofitz at ComputerMinds commentedChanges in response to #133 and #134:
I would appreciate opinions on a change I made in the name of extension: previously the query() function of BlockTranslation contained a leftJoin from i18n_blocks to block. In trying to extend Block I switched the tables which of course did not work. @dipakmdhrm found a solution by replacing the leftJoin with innerJoin, but I'm not comfortable with this because it is not a like-for-like replacement. Ideally it would be a rightJoin, but that has been deprecated. Do we have to drop the call to parent::query() in BlockTranslation::query() (which would make life complicated because it also seta a few properties) or is the innerJoin acceptable?
I've struggled to even put this question into words let alone answer it so hopefully someone else will understand what I'm talking about and will have an answer!
Comment #137
phenaproximaThis looks quite good. Only a few minor things.
This should be using the migration_lookup plugin, not migration. Additionally, should we skip the row if the migration_lookup comes back empty?
This should be protected.
Let's use $this->container rather than \Drupal::service().
Should be protected.
If innerJoin() is not ideal, then we should use whatever way is most ideal. It seems to me that dropping the call to parent::query(), and copy-pasting the code from the parent method, is the way to go so that we can use the non-deprecated leftJoin(), which is the documented replacement for rightJoin(). As long as we have a comment explaining the copypasta, I'm OK with that.
Comment #138
jofitz CreditAttribution: jofitz at ComputerMinds commentedA couple of changes and a question back to @phenaproxima:
Comment #139
quietone CreditAttribution: quietone as a volunteer commented@Jo Fitzgerald, thanks. And here is an update to the source plugin query.
Comment #140
quietone CreditAttribution: quietone as a volunteer commentedAh, silly thing. I was uploading patch but Jo Fitzgerald beat me to it. Patch -139 has the changes to the source plugin query.
Comment #141
phenaproximaIt was changed in the base classes (KernelTestBase et. al.), so we should change it down the line. There is no reason for the $modules property to be publicly exposed. That said, in the context of this issue, it's a nitpick we don't need to bother with.
I did find one superdupernit, fixable on commit.
This line should be 80 characters long. :)
If the tests pass, I think this one is ready for RTBC.
Comment #142
phenaproximaOkay. All seems legit here. RTBC for patch-139 in #139.
Comment #143
jofitz CreditAttribution: jofitz at ComputerMinds commentedIt only takes a moment to resolve those minor nits.
Comment #144
jofitz CreditAttribution: jofitz at ComputerMinds commentedThe changes are so minor that this can be safely returned to RTBC.
Comment #146
jofitz CreditAttribution: jofitz at ComputerMinds commentedSo it seems that making $modules protected is a little more involved - it needs to be changed 'all the way up the chain' on all of its ancestor classes too otherwise an error occurs.
As @phenaproxima said this is "a nitpick we don't need to bother with" (and for simplicity's sake) I have removed this change. Perhaps we could have a follow-up ticket that changes all instances of $modules to protected?
Comment #147
jofitz CreditAttribution: jofitz at ComputerMinds commentedSurely this change can be safely set back to RTBC... (famous last words)
Comment #148
phenaproximaThat sounds good. Sorry about the wild goose chase.
Will you open a follow-up to convert all Migrate tests to the new standard? Then I think we’re done here...
Comment #149
quietone CreditAttribution: quietone as a volunteer commentedFollow up created, #2918296: Change all instances of $modules to protected.
Comment #150
Gábor HojtsyLooking at the patch, I am not convinced this is migrating what the D6 translation system means with the blocks (based on the above discussions especially between @maxocub and @quietone), so will try to reproduce the D6 examples from @maxocub above soon.
Comment #151
Gábor HojtsyNow more than a week passed but I did not get around to test D6 i18n earlier, sorry for that. What I wanted to verify is what feature is covered by this migration. Steps I did:
1. Installed D6 with i18n.
2. Enabled block translation (this enabled string translation and locale).
3. Added Hungarian, enabled path prefix negotiation.
4. Enabled the Who's online block but retitled as "Whooooose online" (otherwise source string would not show up for locale).
5. Locale table indicated there is 1 untranslated block title now for Hungarian.
6. Went to translate that.
This made the block title show up translated in Hungarian when visiting /hu on the site. The feature here does not require tying the block to a specific language, so I agree with @quietone that no migration for that is required to solve this. I was also concerned that we are migrating this to a translation and not to a block in a specific language, but that also seems correct, since that is what D6 does.
So this looks good as-is to me :)
Not committing yet as we are in the middle of doing a core patch release.
Comment #152
Gábor HojtsyComment #153
catchI understand the reason for the mapping, but what happens with contrib blocks here? Or would people need to build a custom migration off this one?
Comment #154
phenaproximaThat mapping was copy-and-pasted from the d6_block migration, which has been that way since forever.
I don't know if it's documented anywhere, but contrib migrations would need to implement hook_migration_info_alter() and change the map so as to include the proper mappings for the blocks they provide. Core's migrations are only concerned with core's blocks.
This is very likely an aspect of the API (such as it is) that should be documented, so should we open a follow-up issue...?
Comment #155
Gábor Hojtsy@catch: the existing d7_block and d6_block migration templates contain the same hardcoded list already so this is not a new thing :)
Comment #157
Gábor HojtsyGiven the above discussion I think this is still good to go. I did not find concerns with the code and verified the source data is considered well, so committed! Thanks all for working on this, it was a long way :)
Comment #159
xjmThe
migration_templates
directory was just deprecated, but this introduced new usages of it (which now causes HEAD to fail). So I reverted this and we need to update the patch to use themigrations
directory instead. Thanks!Comment #160
quietone CreditAttribution: quietone as a volunteer commentedTagging as novice.
The task is to rename the directory migration_templates to migration. That's all.
Comment #161
RytoEX CreditAttribution: RytoEX as a volunteer commentedI've attempted to address #159 and #160. As this is my first attempt to contribute on Drupal.org, feel free to let me know if I've mucked it up. There seems to be multiple suggested naming conventions for patches, so I used [issue_id]-[new_comment_number], which seems to have been used here.
Comment #162
quietone CreditAttribution: quietone as a volunteer commented@RytoEX, Welcome! This patch is great! I agree that there are a few ways people name patches, but they always have the issue number and comment number, which you have done. The only problem is that I typed 'migration' instead of 'migrations' as the new directory name. You up for more practice at making a patch? (I've been plagued by typos lately and my reviewing skill hasn't caught up to the extra work.)
Comment #163
RytoEX CreditAttribution: RytoEX as a volunteer commented@quietone No problem. I've provided a new patch per #162 and new interdiffs against #146 and #161.
Comment #164
heddnSeems like a legit failure. Why can't it find d6_block_translation migration?
Comment #165
quietone CreditAttribution: quietone as a volunteer commentedi18n blocks was in the list returned by getMissingPaths.
Comment #166
ao2 CreditAttribution: ao2 as a volunteer commentedWith the patch from #165 I get this error while trying to migrate a site:
I can post parts of the blocks and i18n_block tables on the d6 site if needed.
Comment #167
quietone CreditAttribution: quietone as a volunteer commented@ao2, yes, please post the data, that will help. And also, please not if you have any contrib or custom modules that would be altering those tables. Thx.
Comment #168
ao2 CreditAttribution: ao2 as a volunteer commentedI don't think I have extra modules altering the
blocks
andi18n_blocks
tables, but the issue seems to happen because of some spurious data ini18n_blocks
.The problem is about menu blocks, I have:
The first row has a delta value which is not present in the
blocks
table.The fact that "primari" is the italian translation of "primary" makes me think that I could have changed the block description at some point and some i18n bug resulted in a duplicate entry in i18n_blocks. Or maybe I deleted and recreated a menu and the code didn't remove the entry from i18n_blocks, I can't really remember because it was many years ago.
Anyways the data results in the query performed by
core/modules/content_translation/src/Plugin/migrate/source/d6/BlockTranslation.php
to returnNULL
values:The last row has
NULL
values.Using an
INNER JOIN
instead of aLEFT JOIN
inBlockTranslation.php
seems to fix the issue, at least here.Comment #169
quietone CreditAttribution: quietone as a volunteer commentedSo the problem reported by ao2, which appears to be caused by bad data in i18n_blocks, is fixed by a changing the query to use an inner join.
Interestingly this approach was used earlier in this patch, see #128, in response to phenaproxima's suggestions in #123. The query was changed to use an inner join to fix the same problem that ao2 encountered.
So, do we use an inner join, or solve the 'bad data' situation in another way?
Comment #171
heddnBefore we add/remove/change the join here, can we get a test that reproduces the issue in all its glory?
Comment #172
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll.
Comment #174
quietone CreditAttribution: quietone as a volunteer commentedForgot to update MigrateUpgrade6ReviewPageTest
Comment #175
quietone CreditAttribution: quietone as a volunteer commentedNW for tests
Comment #176
quietone CreditAttribution: quietone as a volunteer commentedUsing the UI I managed to do the magical steps to create a failure, just like that reported by ao2 in #168. I used the hint there and created translated menus and blocks and then deleted a menu. It actually wasn't that difficult, but I did not keep notes of the steps.
The results are an i18n_blocks table with 3 new entries and a blocks table that does not have an entry for one of the those, specifically ibid = 2.
The fail patch uses the left join and the patch uses an inner join.
Comment #179
jofitz CreditAttribution: jofitz at ComputerMinds commentedFix a couple of test failures by matching with changes to the fixture.
Minor correction to a variable type.
Comment #181
quietone CreditAttribution: quietone as a volunteer commentedAnd content tag to the migration.
Comment #183
quietone CreditAttribution: quietone as a volunteer commentedUsed the wrong tag in the new migration.
Comment #185
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll.
Comment #187
quietone CreditAttribution: quietone as a volunteer commentedThis is failing on menu links (node/11 and node/13, which become node/10 and node/13) and needs to be tested with #2225587: Migrate D6 i18n menu links installed.
Comment #188
quietone CreditAttribution: quietone as a volunteer commentedSo, let's postpone on that and avoid some rerolling.
Comment #189
heddnNo longer blocked.
Comment #190
quietone CreditAttribution: quietone as a volunteer commentedRetesting latest patch
Comment #192
quietone CreditAttribution: quietone as a volunteer commentedYes, needs a reroll
Comment #193
yogeshmpawarAssigning myself for Re-roll.
Comment #194
yogeshmpawarRe-rolled the patch against 8.6.x branch.
Comment #196
quietone CreditAttribution: quietone as a volunteer commented@Yogesh Pawar, thanks for the reroll. It can be tedious to reroll when the database dump is involved.
I've opted to make a reroll from the patch in #183 because when the dump is involved I prefer to go through it myself and that helps me find errors. Let's see what errors this patch generates.
Comment #198
quietone CreditAttribution: quietone as a volunteer commentedWhen I made the previous patch I forgot to dump the database file. This will take care of that mistake.
Comment #200
quietone CreditAttribution: quietone as a volunteer commentedJust noting the error is from the menu 'fr -Test 2'.
Comment #201
quietone CreditAttribution: quietone as a volunteer commentedThe failures are due to one of the changes made to the test fixture in #176. That change was an addition of a french only menu and while that causes errors and needs some investigation that it outside the scope of this issue. I removed that and a full migration was successful locally so I assume that MigrateUpgrade6 will pass. The change needed to test the problem that ao2 identified remains in the test fixture.
To confirm that this still fixes the problem identified by ao2 where an inner join is needed a fail patch is included that uses a left join. Let's see if testbot agrees.
Comment #204
quietone CreditAttribution: quietone as a volunteer commentedNow fix the entity counts.
Comment #205
quietone CreditAttribution: quietone as a volunteer commentedI've been wanting to simplify the changes to the test fixture and reroll the patch. And here is that attempt.
The changes to the test fixture are now;
1) Add a translation of the title of the Navigation block
2) Add a new menu 'Translation test'. Then configure the 'Translation test' block and a translation of the title. Then delete the menu 'Translation test'. That adds a row to the i18n_blocks table with NULLs which replicates the problem reported by ao2.
Comment #207
quietone CreditAttribution: quietone as a volunteer commentedOh yes, and restore the entity counts.
Comment #209
quietone CreditAttribution: quietone as a volunteer commentedFix the remaining tests.
Comment #210
maxocub CreditAttribution: maxocub as a volunteer commentedAssinging for review
Comment #211
maxocub CreditAttribution: maxocub as a volunteer commentedThis will need a re-roll.
Other than that, just a few nits:
This constant is only used one time. Does it need to be a constant?
Looking at the namespace and the plugin ID, this plugin is only used for D6, so I don't think we need to do
parent::query()
. The block table will always be the same.Since we add the module & delta fields with addField(), we can remove them from fields().
Comment #212
maxocub CreditAttribution: maxocub as a volunteer commentedComment #213
quietone CreditAttribution: quietone as a volunteer commentedStart with a reroll
Comment #215
quietone CreditAttribution: quietone as a volunteer commentedFrom #211
1. Yes, it does need to be a constant. It is the property name being migrated and it doesn't change.
2. That is true but this also needs the Block::prepareRow() which uses properties which are setup in Block::query().
3. Yes, fixed as suggested.
Comment #217
jofitz CreditAttribution: jofitz at ComputerMinds commentedRemove redundant use statement.
Comment #219
maxocub CreditAttribution: maxocub as a volunteer commented@quietone, re #215: Thanks for the explanation. I think this is ready now.
Comment #220
quietone CreditAttribution: quietone as a volunteer commented@Jo Fitzgerald, thanks for cleaning up my mistakes.
Comment #221
quietone CreditAttribution: quietone as a volunteer commentedSorry, I think this needs a pause and a double check that the source plugins and migrations are in the desired directory. This has a different structure than the menu links translation it needs to be double checked.
Comment #222
heddnAssigning to quietone to review.
Comment #223
quietone CreditAttribution: quietone as a volunteer commentedLike the other i18n migration, move files to block module, except for the migration.
Comment #225
quietone CreditAttribution: quietone as a volunteer commentedNamespace error
Comment #226
quietone CreditAttribution: quietone as a volunteer commentedThe review here is to confirm that the migration files are in the correct directory. Only the migration is to be content_translation and the related file in block. This is to follow the pattern of #2225587: Migrate D6 i18n menu links.
Comment #227
maxocub CreditAttribution: maxocub as a volunteer commentedThe new patch only differs from last RTBC by classes moved from Content Translation to Block. I agree with this choice, so back to RTBC.
Comment #229
maxocub CreditAttribution: maxocub as a volunteer commentedNeeds a re-roll, again.
Comment #230
quietone CreditAttribution: quietone as a volunteer commentedRetested the latest patch, #225 and passed. No reroll need probably because #2886609: Migrate translations for D6 i18n taxonomy 'localized' terms was reverted. Therefore, restoring RTBC.
Comment #231
quietone CreditAttribution: quietone as a volunteer commentedI mean RTBC nor NR
Comment #232
alexpottWe say left join but we do an inner. What's the point of doing the block_module and block_delta when we know these are equal to the values from i18n_blocks?
We also have 'type', 'ibid', 'block_module' and 'block_delta'.
And the parent::fields() also returns
Should the query also return the missing fields from the block table?
Comment #233
quietone CreditAttribution: quietone as a volunteer commentedWill do this soon
Comment #234
quietone CreditAttribution: quietone as a volunteer commented1. Corrected the comment and reworked the query.
2. fields() no longer uses fields from the parent and 'type' and 'ibid' have been added. Also, added a prepareRow that does only what is needed, adding the default_theme to the row, which is not in fields() only because I see that the parent does not include it.
Comment #235
quietone CreditAttribution: quietone as a volunteer commentedUn-assigning so someone can review
Comment #236
masipila CreditAttribution: masipila as a volunteer commentedI review the latest patch that addresses @alexpott's feedback in #232.
Only one question: We add default_theme in the prepareRow() method. Should we include this source property in fields()?
Otherwise this looks good to me. Leaving to NR for the question above. Once that is clarified, this looks ready.
Markus
Comment #237
quietone CreditAttribution: quietone as a volunteer commentedI wasn't sure about default_theme. As I said in #234.2 it isn't added in the parent and even though this no longer uses the parent::prepareRow() I don't know why it wasn't included and didn't want to change it arbitrarily. I mean if we change it here it should be changed in the parent:fields() as well.
Comment #238
masipila CreditAttribution: masipila as a volunteer commentedI believe we should add the properties that we set in
prepareRow()
tofields()
.We are doing it for example in #2975509: Migrate D6 vocabulary language settings so for the sake of consistency, we should do it here as well.
Comment #239
quietone CreditAttribution: quietone as a volunteer commentedThanks masipila. Added default_theme to fields() and updated the source plugin test to also test that property. Add added a space for coding standards.
Comment #240
masipila CreditAttribution: masipila as a volunteer commentedThis was RTBC in #227. All feedback since that has been addressed.
I updated the Issue Summary to help committers to review this. I also queued this to PostgreSQL anf SQLite tests once more. Once they pass, this is ready.
Markus
Comment #241
masipila CreditAttribution: masipila as a volunteer commentedAnd the tests are green. RTBC.
Comment #242
Gábor HojtsyComment #244
Gábor HojtsyWow, quite some work in this since I last comitted it in November 2017. And it looked like just a directory rename :) Thanks all for continued work on this.
Committed 9319cfd and pushed to 8.6.x.