drupalBlock() should call hook_block_view_alter()

Created on 26 May 2021, about 3 years ago
Updated 26 February 2023, over 1 year ago

Problem/Motivation

drupalBlock() builds the block manually but then doesn't call hook_block_view_alter(), thus the block isn't really built identical to how it would be built had this been placed as a block.

Proposed resolution

Add code to \Drupal\twig_tweak\BlockViewBuilder that mimics what happens in \Drupal\Block\BlockViewBuilder.

API changes

Note that an argument was added to the BlockViewBuilder() contructor. To ensure that this is non breaking, I set the new argument's default value of NULL, and retrieve it if it is missing.

✨ Feature request
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States douggreen Winchester, VA

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