'Remove non-existent tokens in output' option is not working.

First, the regexp in hansel.actions.inc on line 27 is not correct. Instead of

$title = preg_replace('/\\[[a-z0-9_\\-]+\\]/si', '', $title);

it should be

$title = preg_replace('/\[[a-z0-9:_\-]+\]/si', '', $title);

But there is a problem - this code is trigger before the tokens are replaced, so this code remove all tokens from the string without replacing them.

Also it's better to use additional option for token_replace() function called 'clear' with value TRUE.
As temporary solution I have commented the line specified above in hansel.actions.inc file and added this option to the token_replace() call.
This patch is in attachment. Please give your opinion on that point. Is it possible to move lines 555 and 556 in hansel.module to be called before calling hansel_action_add_single_link_get_crumbs() function (on line 476 I think)?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

berdyshev’s picture

Status: Active » Needs work
FileSize
2.1 KB

Sorry, I forgot to attach patch

berdyshev’s picture

Issue summary: View changes

code corrected