Closed (fixed)
Project:
Webform Rules
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2011 at 21:30 UTC
Updated:
5 Dec 2011 at 16:20 UTC
I need to access the submission id (sid) in my rule, but it's not included in the $data variable.
Adding the following snippet at line 37 in the webform_rules_client_form_submit function in webform_rules.module works, but surely there's a better way....
// Add details to $data array.
foreach ($form_state['values']['details'] as $detail => $value) {
$data[$detail]['name'] = $detail;
$data[$detail]['value'] = $value;
}
Comments
Comment #1
stborchertHi.
You can either use the token
[data:sid]or print it with<?php $data['sid']; ?>.I've checked this with the latest dev and it works using
<?php dpm(array($data, '[data:sid]'));?>.Result: https://img.skitch.com/20111119-fncdjw323irf94w8hqn7w3hnq6.png
Comment #2
jesss commentedThat works -- thanks!