From homebox_build():

  foreach ($blocks as $block) {
    if (!isset($info[$block['module']])) {
      $info[$block['module']] = module_invoke($block['module'], 'block_info');
    if (isset($info[$block['module']][$block['delta']])) {
      $allowed_blocks[$block['module']][$block['delta']] = $info[$block['module']][$block['delta']];
      if (!empty($block['title'])) {
        $allowed_blocks[$block['module']][$block['delta']]['info'] = $block['title'];

The module_invoke call here stops hook_block_info_alter() from working. It needs to call the hook as well somehow.

Members fund testing for the Drupal project. Drupal Association Learn more


samhassell’s picture

Status: Active » Needs review
698 bytes

A bit more detail - I'm trying to rename the Custom Block, which by default gets the string "Homebox custom block". I can do this on the homebox layout page, but doing so stops the title being overridden when the user supplies their own title.

My solution was to create a hook_block_info_alter() in my custom module and change the title there. That doesn't take because homebox_build() never invokes the alter hook (I ran through with a debugger to confirm this).

I guess the solution is to trigger the alter hooks after module_invoke, and thats what this patch does.


mgifford’s picture

This patch applies. You want the user supplied title to be overwritten by the string the administrator supplies?

I'm just missing the steps to test this.