At the moment then redirect confirmation link contains only the $node->nid param.
In my case I need to output different confirmation messages due to submission data. And I need to know if it's the first message after submitting the form or after clicking the confirmation link.
I added two parameters
diff --git a/webform_confirm_email.module b/webform_confirm_email.module
index e490c27..62231be 100644
--- a/webform_confirm_email.module
+++ b/webform_confirm_email.module
@@ -245,6 +245,8 @@ function webform_confirm_email_confirmation($node,
array(
'query' => array(
'share' => 'node/' . $node->nid,
+ 'sid' => $submission->sid,
+ 'confirm' => true,
),
)
);
Now I can determine in "webform-confirmation-[nid].tpl.php" if it's the confirmation message (after clicking the link) and I can get the submission data to output different messages.
$submission = webform_get_submission($node->nid, $sid);
$confirm = (drupal_get_query_parameters()['confirm'] != null) ? true : false;
$firstInputForExample = $submission->data[1][0];
Comments
Comment #1
justb3a commentedComment #3
matthias_mo commentedThanx for the patch, committed to 7.x-2.x.
Comment #4
justb3a commentedhi, sorry, it does not work for me. I checked out branch 7.x-2.x and in the module file there is just drupal_goto($redirect_url); without any additional params. I changed it to
And now it works fine for me again.
I found the commit which removes my patch: http://cgit.drupalcode.org/webform_confirm_email/commit/?h=7.x-2.x&id=fe....
Comment #5
justb3a commentedComment #6
matthias_mo commentedThis change leads to access denied problems as reported here:
https://www.drupal.org/node/2453249
Comment #7
justb3a commentedThe param is not allowed to be named sid. This leads to the Access denied problem.
Therefore I named the param subid and everything works perfect!
Comment #9
matthias_mo commentedusing subid as query parameter is not a solution, there is a reason why webform decided to protect anonymous access to the result page.
I comitted a change that should fix this issue properly.
Comment #10
matthias_mo commented