token 7.x-1.2 fixed #1515978: Support token replacement for block titles which means that it no longer accepts [node:field-whatever] tokens in the block title field. This is a reasonable restriction for token - it has no idea if there will be a contextual node to reference - but not for cck_blocks, as the block must be coming from a node!

We therefore need to tell cck_blocks that [node:...] tokens are valid for block titles. Even when we do that, there is a bug in token #1863910: Don't overwrite #token_types set by other modules that will overwrite our setting. I've uploaded a patch for token already, patch for cck_blocks to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ianthomas_uk’s picture

Status: Active » Needs review
FileSize
769 bytes
damien_vancouver’s picture

Status: Needs review » Closed (fixed)

Reproduced, tested, and committed to 7.x-1.x in commit 7ff4c96.

I'll comment on the patch at #1863910: Don't overwrite #token_types set by other modules as well.

Thanks for this!

ianthomas_uk’s picture

Thanks for the quick commit!

There's nothing more frustrating than doing all the work to fix a bug, then seeing your patch sit there doing nothing (or worse bit rotting so you can't even use it yourself).

damien_vancouver’s picture

Indeed! We'll see how the token patch comes along. Token is a lot harder to get changes into, as they affect sooooooo many users, and often even the most innocuous change causes disastrous regressions.... Drupal 7 and token have had a really rough go of it. Hopefully the worst is behind us there though, and your patch at #1863910: Don't overwrite #token_types set by other modules gets committed promptly too! I hope so, because I think a lot of cck_blocks users are less technical and won't have much fun applying patches with git!

I'll continue to help you move that one along as I can. Anyway, thanks again for this fix! I actually just noticed this problem last week (was shown it by a user) which led to a large groan on my part! Imagine my surprise this morning to wake up and find it fixed! :) Cheers!

ianthomas_uk’s picture

This is fixed in token 7.x-1.5 (not 1.4 as currently noted on the module page)

rogernyc’s picture

Title: Unable to use [node:...] tokens in block titles with token >= 7.x-1.2 » Unable to use [node:...] tokens in block titles with token >= 7.x-1.2 - same for views blocks
Project: CCK Blocks » Token
Status: Closed (fixed) » Needs work

Having same issue with for views blocks - they aren't accepting [node:...] tokens. D7.22, Views 7.37, Token 7.1.5

Dave Reid’s picture

Project: Token » CCK Blocks
Status: Needs work » Closed (fixed)

Normal core blocks and Views blocks do not have any kind of [node:*] context at all, so you are not able to use those tokens. Also please don't re-open closed issues unless you are very sure you have having the same exact issue with the same exact module (CCK Blocks, not Views).

rogernyc’s picture

Thanks and apologies.

WisTex’s picture

Issue summary: View changes

Instead of disallowing it, it could have been made smarter so that if the variable does not exist, it displays nothing. Drupal does allow blocks to not have titles.

After all, someone who wishes to place the Node Author's name in the block title, would probably be smart enough to pick which types of pages they want it displayed on. And if they forget to set that, when they browse their site, a weird node with a blank title will appear, which they will fix posthaste, by making the node only appear for certain node types.

So instead of just disallowing it because some people might make a mistake, it probably should have been made smart enough to compensate for someone's error.

ianthomas_uk’s picture

@WisTex That nothing to do with CCK Blocks, so isn't relevant for this issue. If you want that functionality back you'd need to raise an issue against Token, but the maintainer of Token commented at #1515978-13: Support token replacement for block titles to say that he considers the current behaviour to be correct so you're unlikely to have much success.