Working with eliza411 and a fresh clone of the sandbox, it looks like there is an issue when migrating multiple (non-custom) block.

My manifest is running the following migrations:

# blocks
- d6_block
- d6_menu

We're migrating from a D6 site with multiple (non-custom) blocks (SQL dump attached).

When we run the migration, we get an "integrity constraint violation" (duplicate key) on the "info" field of the "custom_block" table.

Looking at the source "blocks" table, none of the non-custom blocks have populated "title" fields. It looks like the "title" field is mapped to the D8 "custom_blocks" "info" field. The "info" field is keyed, so it looks like the first block is migrated fine, but then all successive blocks hit the same "duplicate key" error.

Looking at the MigrateBlockTest.php, it appears that this test is only checking the migration of a single block. Would it make sense to modify this test to check the migration of multiple blocks?

Thanks,
-mike

CommentFileSizeAuthor
#5 custom_blocks-2214229-5.patch481 bytesultimike
#3 source.sql_.zip127.17 KBultimike

Comments

eliza411’s picture

eliza411’s picture

Title: Migrate multiple (non-custom) blocks » Block: Migrate multiple (non-custom) blocks
ultimike’s picture

Issue summary: View changes
StatusFileSize
new127.17 KB
ultimike’s picture

I just retested this on an up-to-date version of the 8.x imp branch, and it is still an issue.

I created a new D6 site, added 2 custom blocks, neither with a block title, and attempted to run the migration. The result was the same.

-mike

ultimike’s picture

StatusFileSize
new481 bytes

I dug down into this issue a bit and I think the issue can be solved by adding a d6_custom_block as a soft-dependency to d6_block (ridiculously simple patch attached).

Now, when I run the following manifest:

# blocks
- d6_block
- d6_menu

# custom blocks
- d6_custom_block
- d6_filter_format

I get no errors and my custom blocks a migrated to the D8 site.

They are not, however placed in the proper regions. I half-expected that if I have a block in the D6 (Garland) "Header" region that it would automatically be placed in the D8 (Bartik) "Header" region as well. The same goes for the "Footer" region.

-mike

benjy’s picture

Title: Block: Migrate multiple (non-custom) blocks » Migrate multiple (non-custom) blocks
Project: IMP » Drupal core
Version: » 8.x-dev
Component: Code » migration system
Category: Support request » Bug report
Status: Active » Needs work

Moving this into the core issue queue since the D6 migrations are now in core. Setting to NW since I believe ultimike is working on mapping the block regions.

ultimike’s picture

Status: Needs work » Closed (duplicate)