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
Right now, d[6|7]_block is a monolithic migration. It would be nice to derive it per (destination) theme and per block plugin type (separating block_content block plugin instances form other ones), and skip those block migrations whose destination theme is not available.
Comments
Comment #2
huzookaThis patch is incomplete; it has to apply the same logic in
BlockTheme::transform()
(next turn).Comment #4
huzookaComment #6
huzookaComment #8
huzookaComment #9
huzookaComment #11
mikelutzAs with #3097336: Improve the DX for migrating content entities: view modes, fields, formatters, widgets etc should be migrated per entity type + bundle, There is no reason to do this in core as you can't run the migrations separately anyway. I'm moving it to migrate_upgrade along with that issue.
Comment #12
huzookaComment #13
Wim Leers#3171980: Menu migration should happen before block migration would be a good addition here, but here we could make it required!
Comment #14
huzookaThis patch derives also block translation migrations.
Comment #15
Wim LeersNice hardening.
HUH! How did this source plugin work at all until now!
This seems like very sensible and overdue hardening 👍
👏 — these also exist in
d7_block
.Comment #16
Wim LeersIn manual testing, this means that
d7_block:bartik:block_content
now gets a required dependency ond7_custom_block
👍This was a bug in all preceding patches.
Comment #17
huzookaComment #18
huzookaCore BlockTranslation (
d7_block_translation
) has a buggy query.This new patch fixes it, and makes us get rid of the duplicated
plugin
andtheme
processes: since the default migrationd7_block
already calculated these, and they were required only by theentity:block
destination plugin.Comment #19
Wim LeersManually tested, works great! 🥳
Comment #20
huzookaAdding #3200936: DX: Block (config) destination shouldn't recalculate block config ID for block translations as related – the patch here already does that.
Comment #21
Wim Leers#3187263: Block configuration translation migrations should be defined in "config_translation", not in "content_translation" and #3189880: Use square brackets syntax in sql queries broke this between
9.1.7
and9.2.0-rc1
.Comment #22
Liam MorlandThe patch does not apply because it is for Drupal core. If this is to be fixed in core, this issue needs to be moved back there. Otherwise, the patch needs to be for migrate_upgrade.
Comment #23
mikelutzWe aren't doing this in core. The issue was moved here intentionally, but yes, it requires a completely different approach to do it in this module.
Comment #24
Wim Leers#3209249: Fix spelling for 29 migrate translation related words conflicted with #21 in 10.2. Rerolled.
Comment #25
Wim Leers