This hook is totally missing.

CommentFileSizeAuthor
drupal.block-region-alter.0.patch756 bytessun

Comments

webchick’s picture

Please explain why this is a bug, else move to D8.

webchick’s picture

Version: 7.x-dev » 8.x-dev
Category: task » feature

Well in fact. It is not a bug, since we never had this hook to begin with in any other Drupal release. Nice idea, though.

sun’s picture

Title: Add hook_block_region_alter() » hook_block_region_alter() is missing in block_get_blocks_by_region()
Version: 8.x-dev » 7.x-dev
Component: base system » block.module
Category: feature » bug
Issue tags: +Quick fix, +API addition

Can we revisit that decision? This hook is only new, because it didn't make sense before, as the collated results of that function were strings. Now that we have renderable arrays in regions, it makes much more sense, and modules should rightfully be able to alter the region contents that have been generated by Block module, before they are passed off to the page building process.

Also, drupal_alter() is very cheap in D7, and this API addition is not able to break anything, so there is absolutely no harm in providing a proper hook at the right location. If you look at it from the right perspective, then contributed module developers can rightfully state: This is a bug, because Block module is missing hook_block_region_alter(), and my use-case/module requires that.

I'm specifically able to think of plenty of use-cases in Panels, Context, and other projects.

webchick’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work

Copy/pasting from the other issue:

"It's not that it's a API breaking change. It's that it's a new feature. Feature freeze ended 12 months ago. The only patches we should be working on at this stage are those that lead directly to Drupal 7 getting released. Drupal 8 for this."

Also, needs work because you don't document this new hook addition. tsk tsk. :P

sun’s picture

Status: Needs work » Closed (won't fix)