Problem/Motivation

Block alter hooks are not being triggered.

Steps to reproduce

* Create a new SDC that has slots.
* Use the SDC as a pattern block in the block layout page.
* On the SDC pattern block, add a block in the region, for instance the branding block.
* On a custom module, add a block view alter hook.
* Clear cache, confirm the alter hook is not invoked.
* Add the branding block as a standard block on a region.
* Confirm the alter hook is for the standard block.

Proposed resolution

function getPropValue() on ui_patterns/src/Plugin/UiPatterns/Source/BlockSource.php should call the alter implementations.

Remaining tasks

Call the alter hooks as the normal blocks builder do.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alemadlei created an issue. See original summary.

alemadlei’s picture

StatusFileSize
new657 bytes

The attached patch should make the build array to be altered by implementations.

alemadlei’s picture

StatusFileSize
new1.5 KB

This new patch also ensures block templates are used when rendering the block sources.

alemadlei’s picture

Title: Block patterns are not triggering alter hooks » Block Sources are not triggering alter hooks
alemadlei’s picture

Status: Active » Needs review
just_like_good_vibes’s picture

Status: Needs review » Needs work

Dear alemadlei,
thank you for reaching us and proposing some modifications, but your proposed code has the MR totally red.
please adjust before sending it to review.
thank you

alemadlei’s picture

@just_like_good_vibes sorry, I see that it ran the checks and I might need to update the test cases to reflect the changes in content. I will proceed to do that.

Thanks for taking your time to check this.