diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-28 12:36:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-28 12:36:26 +0000 |
commit | 19a45ce5446f1ebc87f98d294a3acffdc8b54478 (patch) | |
tree | 29182a43073943cc35a35aa4d68964a44e7eaa08 /modules/block | |
parent | 748c31038d0de19185c7c176731d7eed958b7c9d (diff) | |
download | brdo-19a45ce5446f1ebc87f98d294a3acffdc8b54478.tar.gz brdo-19a45ce5446f1ebc87f98d294a3acffdc8b54478.tar.bz2 |
- Patch #765860 by effulgentsia, dww, dereine, mikey_p, sun: make drupal_alter() support multiple alter hooks executed by module weight.
Diffstat (limited to 'modules/block')
-rw-r--r-- | modules/block/block.api.php | 6 | ||||
-rw-r--r-- | modules/block/block.module | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/modules/block/block.api.php b/modules/block/block.api.php index 96c92668e..cec99223b 100644 --- a/modules/block/block.api.php +++ b/modules/block/block.api.php @@ -192,7 +192,7 @@ function hook_block_view($delta = '') { * - delta: The identifier for the block within that module, as defined within * hook_block_info(). * - * @see hook_block_view_alter() + * @see hook_block_view_MODULE_DELTA_alter() * @see hook_block_view() */ function hook_block_view_alter(&$data, $block) { @@ -213,10 +213,6 @@ function hook_block_view_alter(&$data, $block) { * Modules can implement hook_block_view_MODULE_DELTA_alter() to modify a * specific block, rather than implementing hook_block_view_alter(). * - * Note that this hook fires before hook_block_view_alter(). Therefore, all - * implementations of hook_block_view_MODULE_DELTA_alter() will run before all - * implementations of hook_block_view_alter(), regardless of the module order. - * * @param $data * An array of data, as returned from the hook_block_view() implementation of * the module that defined the block: diff --git a/modules/block/block.module b/modules/block/block.module index 93f4389e4..12b916ad0 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -762,9 +762,8 @@ function _block_render_blocks($region_blocks) { $array = module_invoke($block->module, 'block_view', $block->delta); // Allow modules to modify the block before it is viewed, via either - // hook_block_view_MODULE_DELTA_alter() or hook_block_view_alter(). - drupal_alter("block_view_{$block->module}_{$block->delta}", $array, $block); - drupal_alter('block_view', $array, $block); + // hook_block_view_alter() or hook_block_view_MODULE_DELTA_alter(). + drupal_alter(array('block_view', "block_view_{$block->module}_{$block->delta}"), $array, $block); if (isset($cid)) { cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY); |