token_form_block_admin_configure_alter() contains the line:

$form['settings']['title']['#token_types'] = array();

this is to prevent you from using a token that might not be replaced when the block is displayed. However, another module may already have a dependency on certain token types and want to display that token where possible (for example, cck_blocks can only be used on node pages, so setting $...['token_types'] = array('node'); is both safe and useful).

If $form['settings']['title']['#token_types'] has already been set by such a module, then we should not overwrite that value. Patch to follow.

#1 token-1863910-overwriting-token-types-1.patch717 bytesianthomas_uk
PASSED: [[SimpleTest]]: [MySQL] 345 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


ianthomas_uk’s picture

Status: Active » Needs review
717 bytes
PASSED: [[SimpleTest]]: [MySQL] 345 pass(es). View
ianthomas_uk’s picture

damien_vancouver’s picture

Status: Needs review » Reviewed & tested by the community

The patch works as intended for me: With it applied to latest Token 7.x-1.x-dev, the latest cck_blocks is able to set block titles once again using [node: ] field tokens.

This is a very important patch for cck_blocks users. Previously (in token <= 7.x-1.2) the [node: ] tokens were available for block titles, which is a very powerful use-case for cck_blocks. After token 7.x-1.2, these node tokens were still displayed under "Replacement Patterns" but were not accepted. Even worse, existing blocks with those field titles were unable to be edited. So... there were users with blocks that could not be edited without breaking their token aware titles and going back to static or no titles.

I will place instructions on the cck_blocks home page that point users at this patch as a workaround. As it is committed and released I'll adjust those instructions accordingly.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #1 to 7.x-1.x. Thanks!

A new release should be out today.

damien_vancouver’s picture

Thank you Dave!

I've updated the CCK Blocks project description to require Token 7.x-1.4 or newer.

Status: Fixed » Closed (fixed)

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