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.
Follow-up to #2402919: D6-D8 Block Migration
Problem/Motivation
Fresh D6 install. Create one custom block. Run the migration. The custom block migrates to D8 and show up in the DB and even show in the correct region of the block layout admin screen. However, the block is not visible on the page.
Comment | File | Size | Author |
---|---|---|---|
#25 | 2410623-25-REVIEW-do-not-test.patch | 8.93 KB | ultimike |
#25 | 2410623-25.patch | 457.39 KB | ultimike |
Comments
Comment #1
lokapujyaComment #2
lokapujyaDo I need some sort of region mapping?
Comment #3
ultimikeWhich theme is active on the D6 site?
-mike
Comment #4
lokapujyaGarland. Then, I'm looking at Bartik on D8. I think that explains it. I'll try it again later and update the issue.
Comment #5
ultimikeHmm - a simple migration from a D6 core theme to a D8 core theme _should_ work. Which D6 (Garland) region was the block in?
-mike
Comment #6
lokapujyaYeah, I didn't do anything special other than place the Manifest file and run the migration. The custom block was in the header.
1. Installed D6
2. Added custom block to header with some text (via the interface.)
3. Ran the migration (with the block Manifest file.)
It shows in the admin screen, but not when visiting the page. I can remove the block and add it back and then it shows on the page.
Comment #7
lokapujyaPHP 5.5.17
Comment #8
ultimikeConfirmed that this is an issue - digging into it now.
-mike
Comment #9
ultimikeThe issue was related to page visibility settings. Where there are none, the visibility array was still being populated, when it shouldn't. Patch attached.
-mike
Comment #10
lokapujyaThat fixes the problem. Maybe we can add a test? It looks like one of the custom blocks doesn't have a visibility setting. Why did tests not fail?
Comment #11
ultimikeYeah, I was thinking about that last night after I posted the patch. The tests didn't fail because the assertions are only checking to see if the listed "pages" (from the visibility settings) are the same.
I'll take another look at it later today and see if I can come up with better tests.
-mike
Comment #12
ultimikeI'm going to look to improve the tests before this is ready for review.
-mike
Comment #13
ultimikeI've added a new "page specific visibility settings" test and improved the existing ones, in addition to the fix to the BlockVisibility process plugin. The addition of the new test required an updated d6.gz dump file.
There are two patches attached - the one marked "-REVIEW" includes everything except for the changes to the d6.gz file.
Thanks,
-mike
Comment #15
ultimikeHeh - just read the fine print on how to add a patch that the testbot will ignore. Attaching renamed patch.
-mike
Comment #16
lokapujyaDo you need to do something special for the binary file? Patch applied for me locally. I got some warning about whitespace, but the tests ran.
Comment #17
lokapujyaSo, I ran the test without the change in BlockVisibility.php to see the expected fails There were 5: the 2 user blocks, menu blocks, and block_2, and block_3. Seems right since those are the ones with no custom visibility.
Not required, but consider doing something like this:
$this->assertTrue(empty($visibility), 'Visibility settings.');
or you get "Value false is TRUE." which doesn't tell us what failed.
Tests work for me locally.
Comment #18
ultimikeReuploading the patch in hopes that it gets tested this time. Note that this is the exact same patch at 13, just a new file name.
@lokapujya - I didn't update the assertions with the extra text - none of the other tests include this help text, and it is easy enough to find the issue from the line number. Thanks for testing it though!
Thanks,
-mike
Comment #20
ultimikeThanks @chx for pointing me to http://mediatribe.net/en/node/63 for instructions on how to create a patch with a binary file in it. Updated patch attached.
Thanks,
-mike
Comment #22
ultimikeComment #23
chx CreditAttribution: chx commentedYou can't roll a binary patch since the core .gitattributes includes
*.gz -text diff
enforcing a normal diff. I added a .gitattributes to the Tests directory overriding this.Comment #24
ultimikeProbably needs a re-roll now that #2415399 is committed.
-mike
Comment #25
ultimikeRe-rolled patch attached - some notes:
-mike
Comment #26
benjy CreditAttribution: benjy commentedO dear, we really need committers to be aware of the Table's folder not been manually editable to stop this happening. I'm not sure what else we can do other than the big comment we already have at the top of the file?
Rest looks fine, RTBC.
Comment #27
alexpottMigrate is not blocked by beta. Committed 9dd8de4 and pushed to 8.0.x. Thanks!