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.
Just like #2897045 - add hook_block_view_alter().
Context module should also implement hook_block_build_alter().
@see https://api.drupal.org/api/drupal/core%21modules%21block%21block.api.php...
See attached patch. Not sure if it's best place, but there is some logic before hand that i'm not sure we should run before it or not -current patch it after.
Perhaps someone can review?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#11 | block_build_alter-2988269-3.patch | 817 bytes | silverham |
#5 | context-Add_block_build_alter_call_to_Block_Reaction-2988269-d8-d.patch | 816 bytes | paulocs |
#2 | block_build_alter-2988269.patch | 675 bytes | silverham |
Comments
Comment #2
silverham CreditAttribution: silverham at EY Digital commentedComment #3
silverham CreditAttribution: silverham at EY Digital commentedComment #4
bzoks CreditAttribution: bzoks at Agiledrop - Your Trusted Drupal Teammates commentedReviewed and tested patch, everything is OK. Placement of code is also consistent with same feature from core Blocks.php.
Comment #5
paulocsPatch is re-rolled.
Comment #6
paulocsComment #8
paulocsFixed in dev branch!
Thanks @all
Comment #10
Daniel KulbeThe
$blockBuild
variable is undefined. There's only$block_build
available!Comment #11
silverham CreditAttribution: silverham at EY Digital commentedAs @daniel-kulbe has pointed out my variable has been misspelt - patch is attached.
Comment #13
paulocsThanks @all! Fixed in dev branch.
Good catch @Daniel Kulbe