Skip to content

Instantly share code, notes, and snippets.

@star-szr
Created September 26, 2011 17:49
Show Gist options
  • Save star-szr/1242851 to your computer and use it in GitHub Desktop.
Save star-szr/1242851 to your computer and use it in GitHub Desktop.
Band-aid fixes for conflict between Block Title Link and Menu Block modules (D7)
<?php
// Mini module to remove Block Title Link options from Menu Block blocks
function MODULE_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'block_admin_configure') {
$module = $form['module']['#value'];
if ($module == 'menu_block') {
// remove fieldset
unset($form['settings']['block_titlelink']);
// remove validate and submit handlers
$form['#validate'] = array_diff($form['#validate'], array('block_titlelink_form_validate'));
$form['#submit'] = array_diff($form['#submit'], array('block_titlelink_form_submit'));
}
}
}
?>
<?php
function THEME_preprocess_block(&$variables) {
$block = &$variables['elements']['#block'];
if ($block->module == 'menu_block') {
unset($block->title_link);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment