Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Some block settings are not imported when running the procedure in the parent issue:
- Show block for specific roles: I also tried adding the d6_user_role migration to the manifest, but it still did not import this setting.
- Title: It imports the default (in code) title, but not the customized (in the D6 database) title.
- Display title: I'd assume that this should be unchecked if the D6 block had a title of "[none]" (with arrows instead of brackets), but it is always checked after import.
Proposed resolution
- When importing data from the D6 blocks table, use the value from the title column if available. Unless it is "[none]" (with arrows) in which case the "Display title" should be unchecked.
- When importing data from the D6 blocks table also join with blocks_roles and get those mapped roles as well.
Remaining tasks
Implement that logic/query.
User interface changes
API changes
Original report by @brockfanning
Comment | File | Size | Author |
---|---|---|---|
#55 | 2281393-migrate-display-label.patch | 685 bytes | drzraf |
#49 | 2281393-49.patch | 10.04 KB | quietone |
#45 | 2281393-45.patch | 3.79 KB | quietone |
#42 | 2281393-42.patch | 82.01 KB | bdone |
#32 | interdiff.txt | 617 bytes | mrjmd |
Comments
Comment #1
brockfanning CreditAttribution: brockfanning commentedComment #2
brockfanning CreditAttribution: brockfanning commentedComment #3
brockfanning CreditAttribution: brockfanning commentedComment #4
brockfanning CreditAttribution: brockfanning commentedComment #5
ultimikeRole-based visibility settings is fixed with #2415399: D6->D8 migration: User role based block visibility settings not migrated properly.
I confirmed with a manual test that the D6 "Block title" isn't properly migrated to D8. The D6 "Block description" is copied (incorrectly) into the D8 title field, and while the D8 "Display title" checkbox is checked, the title isn't actually displayed. When I manually re-saved the block configuration (with no changes), the (incorrect) block title is displayed.
I'll go ahead and start working on a patch to:
-mike
Comment #6
ultimikePatch attached.
-mike
Comment #7
benjy CreditAttribution: benjy commentedThis looks good to me, how about a failing version of the patch to prove the tests work?
Comment #8
ultimikeGood idea. Fail patch attached.
-mike
Comment #10
tadityar CreditAttribution: tadityar commentedThe failed patch was purposely created to fail, moving to needs review.
Comment #11
benjy CreditAttribution: benjy commentedThis implies that $settings['title'] isn't set at all if title is < none>. Is that right?
Comment #12
ultimikeGood catch. Actually, I totally missed the D8 block
$settings['label_display']
setting. Updated patch includes support for this setting.Also - I noticed that my re-roll of #2410623: D6-D8 Custom Block Migration not visible in region failed to include core/modules/migrate_drupal/src/Tests/.gitattributes, so I've added it to this patch as well.
-mike
Comment #13
ultimikeRe-roll due to #2416111: Migrate Dump export needs to have a consistent order and #2413759: Move D6 dumps to avoid collisions with D7 dumps.
-mike
Comment #15
ultimikeSetting to "Needs review" as the FAIL test was meant to fail.
-mike
Comment #16
mrjmd CreditAttribution: mrjmd commentedDidn't get to do a full functional review, but it looks like one of your new lines in MigrateBlockTest.php got appended onto an existing line (for all three versions). I've new versions with that fixed.
Comment #19
mrjmd CreditAttribution: mrjmd commentedHmm let me try that again.
Comment #20
mrjmd CreditAttribution: mrjmd commentedComment #23
ultimike@mrjmd - good find, thanks! Not sure why your patch wasn't applying - did you create it with
git diff --full-index --binary > filename.patch
?Patch updated.
-mike
Comment #24
benjy CreditAttribution: benjy commentedLooks good.
Comment #25
anavarre+1 - Works really well.
Comment #26
alexpottThere's a constant for this. See BLOCK_LABEL_VISIBLE
New line needed
Comment #27
XanoComment #28
benjy CreditAttribution: benjy commentedSeems to fix the concerns from #26, thanks.
Comment #30
mrjmd CreditAttribution: mrjmd commentedHere's a straight reroll of #27. There was a minor conflict in BlockSettings.php caused by the switch to MigrateExecutableInterface, pretty sure I've resolved it properly.
Comment #31
benjy CreditAttribution: benjy commentedCan we get an interdiff?
Comment #32
mrjmd CreditAttribution: mrjmd commentedInterdiff.
Comment #33
benjy CreditAttribution: benjy commentedThanks, still RTBC for me
Comment #34
alexpottAdding this means you can no longer produce migrate patches just using git diff without doing git diff --binary. This should be discussed in a different issue.
Comment #35
ultimikeI think that we only need to use
git diff --binary
when there is a change to a test that involved a change to the source DB (d6.gz in this case), this has been the case since #2348875: Improving our dump files.I guess I'm not clear on why that stops this patch from getting committed?
On a related note, I just created #2452709: migrate_drupal test dump generation documentation to improve the dump generation documentation.
-mike
Comment #36
douggreen CreditAttribution: douggreen commentedCan you just switch from storing the file as a .gz and instead use a .sql?
Comment #37
ultimikeDiscussing the .gz issue over at #2469623: Process for creating migration source DBs for automated tests.
-mike
Comment #38
ultimikeWaiting for #2281393: D6->D8 Blocks - Custom titles not imported.
-mike
Comment #39
bdone CreditAttribution: bdone commentedtrying a re-roll, using the now RTBC'd #2469623: Process for creating migration source DBs for automated tests. not sure about this diff yet, since this is a new process for me.
Comment #40
bdone CreditAttribution: bdone commentedcorrecting for block id (bid) 8 and so we can diff patches in this new process.
Comment #41
vendion CreditAttribution: vendion commentedThis is a secondary diff correcting block id 8.
Comment #42
bdone CreditAttribution: bdone commentedworked with @vendion to get this new process working. this patch is from both of us and is the re-roll of #30, using the script generated dump from #2469623: Process for creating migration source DBs for automated tests.
Comment #44
bdone CreditAttribution: bdone commentedguessing this failed, because #2469623: Process for creating migration source DBs for automated tests is not yet in.
Comment #45
quietone CreditAttribution: quietone commentedReroll. The patch is much smalled because the patch in #42 had lots of changes to unrelated dump tables.
Comment #48
quietone CreditAttribution: quietone as a volunteer commentedComment #49
quietone CreditAttribution: quietone as a volunteer commentedRerolled.
Tested locally and worked fine.
Comment #50
benjy CreditAttribution: benjy at PreviousNext commentedLooks good to me.
Comment #51
catchCommitted/pushed to all three 8.x branches, thanks!
Comment #55
drzraf CreditAttribution: drzraf commentedthis hunk seems to have been forgotten
D6's
<none>
labeled blocks must not have their label shown in D8Comment #56
drzraf CreditAttribution: drzraf commentedping for reopen @catch