Hello,

I would like to request one feature in upcoming version of webform. In current version if i want to get value of $sid of currently submitted form by another module than i am not able to get. So make some new function / hook by which my module can call that function and get latest $sid for submitted form by user.

I got some suggestion that i can get $sid vaule with help of $_GET on next page but what my page is redirected to another node after submission ? At that time it is not possible to get value of $sid.

Currently i have to do 1 line of code modification in webform_submission.inc file where webform_submission_insert function get called. i have to insert session variable to store value of $sid before return. This is not a good solution but i have to manage it.

In past i have tried lots of things to get this $sid but i failed. Finally i decided to request this feature in new version.This will help a lot for other modules also in which anyone wants to save current $sid value in database.

I hope my this request will be considered.

Thank you
Tejas Mehta

Comments

tejaspmehta’s picture

Hello,

Currently i did find this way but if any other methods are there than please share it.

function modulename_form_alter(&$form, &$form_state, $form_id)
{
	
  if ( ereg('^webform_client_form_', $form_id) ) 
  {
  	$form['#submit'][] = 'modulename_getsid';
  }
  return $form;
}

function modulename_getsid(&$form, &$form_state) 
{
	$nid = $form_state['values']['details']['nid'];
	$sid = $form_state['values']['details']['sid'];
}
tejaspmehta’s picture

Status: Active » Closed (fixed)