Skip to content

Instantly share code, notes, and snippets.

@StryKaizer
Created April 14, 2014 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StryKaizer/10652041 to your computer and use it in GitHub Desktop.
Save StryKaizer/10652041 to your computer and use it in GitHub Desktop.
webform fix tokens
<?php
/**
* Implements hook_template_preprocess
*
* - Webform 3 ondersteund geen tokens in submission page, dit zorgt ervoor dat we wel tokens kunnen gebruiken.
*/
function hook_preprocess_webform_confirmation(&$vars) {
$confirmation = check_markup($vars['node']->webform['confirmation'], $vars['node']->webform['confirmation_format'], '', TRUE);
module_load_include('inc', 'webform', 'includes/webform.submissions');
$submission = webform_get_submission($vars['node']->nid, $vars['sid']);
$confirmation = _webform_filter_values($confirmation, $vars['node'], $submission, NULL, FALSE, TRUE);
// Strip out empty tags added by WYSIWYG editors if needed.
$vars['confirmation_message'] = strlen(trim(strip_tags($confirmation))) ? $confirmation : '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment