Blocks rendered via bamboo_render_block do not use the block theme hook

Created on 31 January 2020, over 4 years ago
Updated 24 April 2023, about 1 year ago

There's a chance this is something to do with our local set up or maybe even expected behaviour but after a lot of debugging and reading the docs I can't say.

When rendering a custom block with bamboo_render_block like so:

bamboo_render_block('block_content:8ad5b2c3-e203-4b3e-90b2-64a7372d80a7')

Then the resulting markup is not wrapped by the block theme hook - i.e. the fields on the block_content entity are rendered directly.

When placing the same block in a region then the block template is used.

A lot of time with xdebug led me to the conclusion that blocks rendered via bamboo twig are not processed by Drupal\block\BlockViewBuilder::preRender which I'm assuming is the cause of the difference in output.

I have also tried using bamboo_render_entity but get the same result:

{{ bamboo_render_entity('block_content', 8, 'full') }}

Thanks for a great module. Any help on this on much appreciated.

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom rattusrattus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024