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
The Layout Builder module has no explicit dependency on the Block module, but relies on it in two (known) places:
'#theme' => 'block'
is used in\Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray::onBuildRender()
, but there is no guarantee the block module will be installed.- The Layout Builder UI relies on local tasks (typically provided by a placed block) for navigation, until #2936655: Layout Builder should use the toolbar modes system once it exists. is resolved
Proposed resolution
Add block.module as a dependency, with an @todo pointing to #3003610: Remove block.module dependency from Layout Builder for potential future removal
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2934223-block-16.patch | 533 bytes | tim.plunkett |
#12 | 2934223-12.patch | 8.79 KB | MerryHamster |
Comments
Comment #2
jibranHere is the patch.
Comment #3
jibranMoved some other stuff.
Comment #4
jibranComment #7
apadernoMoving code is just the first step. There are tests that need to be changed too.
Comment #8
apadernoI think it makes more sense to do one of the following:
Comment #9
tim.plunkettComment #10
tim.plunkettComment #11
MerryHamster CreditAttribution: MerryHamster at Skilld commentedonly reroll #4 patch to 8.7.x
Comment #12
MerryHamster CreditAttribution: MerryHamster at Skilld commentedsorry, #11 I forgot to remove ".orig" files after the patch had applied
here only reroll #4 patch to 8.7.x
Comment #13
MerryHamster CreditAttribution: MerryHamster at Skilld commentedComment #15
tim.plunkettI opened #3003610: Remove block.module dependency from Layout Builder as a follow-up issue. Let's just declare the dependency to resolve the stable blocker, and work on removing it later.
Because in addition to the block template, we also require the local tasks block be available, at least until #2936655: Layout Builder should use the toolbar modes system once it exists. is resolved.
Comment #16
tim.plunkettComment #17
tim.plunkettComment #18
jibran#15 makes sense to me. I think removing dependencies after stable release is not a BC break.
Comment #19
EclipseGc CreditAttribution: EclipseGc at Acquia commentedFWIW, I 100% support this approach.
Eclipse
Comment #21
webchickMakes sense! In #3003610: Remove block.module dependency from Layout Builder it'd be good to provide some rationale as to why this is a good thing to do, but that's separate from this issue which just states the current situation factually. :)
Committed and pushed to 8.7.x. Thanks!
Comment #23
webchickSorry; also backported to 8.6.x.