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

justb3a’s picture

  • matthias_mo committed 0e80db9 on 7.x-2.x
    Accepted patch from @justb3a for issue #2400365: Adding SID and...
matthias_mo’s picture

Status: Patch (to be ported) » Closed (fixed)

Thanx for the patch, committed to 7.x-2.x.

justb3a’s picture

hi, 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

~/Projects/../public/sites/all/modules/webform_confirm_email (7.x-2.x ✗) ✹
❯ g diff webform_confirm_email.module
diff --git a/webform_confirm_email.module b/webform_confirm_email.module
index 20e4774..ffb89eb 100644
--- a/webform_confirm_email.module
+++ b/webform_confirm_email.module
@@ -244,7 +244,15 @@ function webform_confirm_email_confirmation($node,
     }
   }

-  drupal_goto($redirect_url);
+  drupal_goto(
+   $redirect_url,
+    array(
+      'query' => array(
+        'subid' => $submission->sid,
+        'confirm' => true,
+      ),
+    )
+  );
 }

 /**

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....

justb3a’s picture

Status: Closed (fixed) » Needs work
matthias_mo’s picture

Status: Needs work » Postponed

This change leads to access denied problems as reported here:

https://www.drupal.org/node/2453249

justb3a’s picture

The 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!

  • matthias_mo committed e6bab7c on 7.x-2.x
    Issue #2400365 reported by @justb3a: provide the submission ID as query...
matthias_mo’s picture

Status: Postponed » Fixed

using 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.

matthias_mo’s picture

Status: Fixed » Closed (fixed)