Working with Beans + homebox a lot, I noticed that the outputted block title in "Add a Block section" uses the non-translatable Bean Label instead of the separate field_title that is outputted (in my case) as the $block->subject. While this affects my beans outputted in homebox, it might affect other modules too that render blocks.
The cause seems to be because $info['info'] in $allowed_blocks, passed to homebox_add_link(), is set before homebox_prepare_block() is run which, in my case, changes the block 'subject'.
by adding this code in homebox_build the $allowed_blocks[$block->module][$block->delta]['info'] is updated with the latest $block->subject
if (!empty($block->subject)) {
// Makes sure that $allowed_block's 'info' (subject/title) is updated with any change
// that happened in homebox_prepare_block
$allowed_blocks[$block->module][$block->delta]['info'] = $block->subject;
}
Comment | File | Size | Author |
---|---|---|---|
#4 | fix_block_title_discrepancy-2342899-4.patch | 1.13 KB | ptsimard |
#1 | fix_block_title_discrepancy-2342899-1.patch | 667 bytes | ptsimard |
Comments
Comment #1
ptsimard CreditAttribution: ptsimard commentedHere is the patch
Comment #2
ptsimard CreditAttribution: ptsimard commentedComment #3
ptsimard CreditAttribution: ptsimard commentedHmm this only works when the block is actually displayed. My bad, I'll work more on this. It seems I need to change it around the when homebox_build does module_invoke($block['module'], 'block_info') instead.
Comment #4
ptsimard CreditAttribution: ptsimard commentedOk this new patch now makes homebox_prepare_blocks() run on every block (not just displayed) and then force the subject rewrite.
I really believe this is a better behavior than to display the block_info administration label on the front end.
Please let me know if this works for you or if there is a better way.
Thanks
Comment #5
drumm