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.
Comment | File | Size | Author |
---|---|---|---|
#1 | token-1863910-overwriting-token-types-1.patch | 717 bytes | ianthomas_uk |
Comments
Comment #1
ianthomas_ukComment #2
ianthomas_ukI have raised cck_blocks issue #1863928: Unable to use [node:...] tokens in block titles with token >= 7.x-1.2 - same for views blocks that depends on this.
Comment #3
damien_vancouver CreditAttribution: damien_vancouver commentedThe 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.
Comment #4
Dave ReidCommitted #1 to 7.x-1.x. Thanks! http://drupalcode.org/project/token.git/commit/7732840
A new release should be out today.
Comment #5
damien_vancouver CreditAttribution: damien_vancouver commentedThank you Dave!
I've updated the CCK Blocks project description to require Token 7.x-1.4 or newer.