'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)?
Comment | File | Size | Author |
---|---|---|---|
#1 | hansel-remove_tokens_error-1411468.patch | 2.1 KB | berdyshev |
Comments
Comment #1
berdyshev CreditAttribution: berdyshev commentedSorry, I forgot to attach patch
Comment #1.0
berdyshev CreditAttribution: berdyshev commentedcode corrected