Hi,
In drupal 6 I added a function to save data from this module into every single webform submission (on DB and not only on email), using a custom module:
function MYMODULENAME_webform_submission_presave($node, &$submission) {
// Update some component's value before it is saved.
$body_footer = theme('contact_google_analytics_footer', $footer);
$body_footer = token_replace_multiple($body_footer);
$component_id = 8;
$submission->data[$component_id]['value'][0] = $body_footer;
}
All works fine and all data from $body_footer are placed into an hidden field ($component_id = 8;) and saved correctly to my DB.
But now with drupal 7 I had got an error:
Fatal error: Call to undefined function token_replace_multiple() in /var/wwwroot/MYSITE/sites/all/modules/MYMODULENAME/custom.module on line 7
Someone could help me to integrate back this function?
Thanks!
Comments
Comment #1
Brian294 commentedTry using token_replace. token_replace_multiple is no longer a valid function in Drupal 7's token.
http://api.drupal.org/api/drupal/includes!token.inc/function/token_repla...
Peace,
Brian
Comment #2
Dret commentedThanks, it works.
But now give me another error in the previous line:
$body_footer = theme('contact_google_analytics_footer', $footer);Any idea about?
Comment #3
Dret commentedIs there anybody out there?? :)
At the moment the problem is still present and after every webform sending this error message appear:
Line 7 is:
$body_footer = theme('contact_google_analytics_footer', $footer);Comment #4
Brian294 commentedI have written another module to do something similar to what you have requested. It's called GA Capture.
https://drupal.org/project/ga_capture
I am seeking sponsorship to develop the webform submodule, take a look:
https://drupal.org/node/2165325
Peace,
Brian
Comment #5
Brian294 commentedI wrote the module, it is available here: https://drupal.org/project/ga_capture