Every time I go to add a value, such as "library" it gets replace with a number "1". I am using this module in conjunction with menu block. I have also tried to type in something like "node/150", but it also gets replaced with the number "1".

Comments

end user’s picture

Have the same issue and also using menu block although I haven't disabled menu block to test it out.

star-szr’s picture

There is a definite conflict with Menu Block, both modules use 'title_link' as a form element name. More information here in the Menu Block issue queue: http://drupal.org/node/1261952

If you're using $block->title_link in your block template this can cause serious problems, here is a workaround for the theme layer which removes $block->title_link for blocks generated by Menu Block.

function THEME_preprocess_block(&$variables) {
  $block = &$variables['elements']['#block'];
  if ($block->module == 'menu_block') {
    unset($block->title_link);
  }
}

As for the block edit form, install this mini module to remove the Block Title Link form from Menu Block blocks if you don't need Block Title Link functionality for your 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'));
    }
  }
}

Both pieces of code have not been thoroughly tested, use at your own risk, etc. etc.

ngmaloney’s picture

Assigned: Unassigned » ngmaloney

@Cottser thanks for the detailed info. I like your solution. Block Title Link's aren't typically needed on a menu_block block so I'll disable them. Should have something rolled into dev release soon.

finedesign’s picture

Thanks for pointing this out. I very much need active links in a few menu blocks. As a non-developer, I'm trying to find a solution to this. It appears the first snippet disables the link. I hope I'm wrong. Can I just paste it into template.php file? I tried changing THEME to my theme name, but still no help.

star-szr’s picture

@finedesign - the first snippet removes the "Block Title Link" link from menu block blocks.

tinokreutzer’s picture

Warming up this thread -

Where do I need to inject the two code snippets to apply the fix supplied by Cottser? I added them to template.php, to no avail - I assume that's not quite the right approach. Also tried the dev version without luck. URL being saved remains '1'.

Help is greatly appreciated!

star-szr’s picture

@tinokreutzer - you can actually add both snippets to template.php, but replace THEME in the first function and MODULE in the second function with your theme_name.

tinokreutzer’s picture

Thanks, but I had done that already. Emptied cache several times as well.

To be clear, could you confirm what each of the snippets are trying to achieve? I'm possibly confused as to its purpose...

I (like the OP, I think) want to use Menu Block together with Block Title Link and want to specify a path for the block title. Since both modules use 'title_link', there is a conflict. Because of this conflict, any path specified in Block Title Link will be saved and displayed as '1'.

The 'title' attribute is being saved properly, btw.

I'm not sure exactly what each of the above code snippets are supposed to remove. Thanks for clarifying.

star-szr’s picture

@tinokreutzer - when both pieces of code are used, they basically disable the Block Title Link module for Menu Block blocks. Not what you are trying to achieve. You'll have to come up with your own solution or patch for Block Title Link, or wait until @ngmaloney fully resolves the conflict between the two modules.

klaasvw’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.82 KB

This patch makes the form array that block_titlelink adds to the block config form array a tree. That way it's namespaced and doesn't get in the way of any other possible form fields.

star-szr’s picture

The patch in #10 looks good, and in my testing fixes the reported conflict with menu block.

barwonhack’s picture

WIll this patch be applied to dev and a new release be issued soon?

codexmas’s picture

Patch in #10 works well for me too.

rainbreaw’s picture

Patch #10 works well for me, also. Thank you @klaasvw

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC since we've had several confirmations that it works.

ngmaloney’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed to release 7.x-1.3

star-szr’s picture

Thanks @ngmaloney!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.