Commit a7b47e17 authored by Liam Morland's avatar Liam Morland Committed by Saul Willers
Browse files

Issue #2474773 by Liam Morland: Token [submission:access-token] should exist

parent 6587c5b2
Loading
Loading
Loading
Loading
+7 −0
Changes for webform.tokens.inc: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ function webform_token_info() {
    'name' => t('Submission ID'),
    'description' => t('The unique indentifier for the webform submission.'),
  );
  $info['tokens']['submission']['access-token'] = array(
    'name' => t('Access token'),
    'description' => t('The security token used to gain access to this webform submission.'),
  );
  $info['tokens']['submission']['date'] = array(
    'name' => t('Date submitted'),
    'description' => t('The date the webform was first save as draft or completed.'),
@@ -108,6 +112,9 @@ function webform_tokens($type, $tokens, array $data = array(), array $options =
        case 'sid':
          $replacements[$original] = $submission->sid ? $submission->sid : '';
          break;
        case 'access-token':
          $replacements[$original] = webform_get_submission_access_token($submission);
          break;
        case 'date':
          $replacements[$original] = format_date($submission->submitted, \Drupal::config('webform.settings')->get('advanced.date_type'), '', NULL, $language_code);
          break;