Hi
I want to show submission Id in "preview message" of "Preview page".
I tick "Automatically save as draft between pages and when there are validation errors " so a draft has been submitted automatically.
I insert [submission:sid] into preview message, but it doesnt work and this alert rise:
"Notice: Undefined property: stdClass::$sid in webform_tokens() (line 88 of /...l/sites/all/modules/webform/webform.tokens.inc)."
thank you.

Comments

danchadwick’s picture

Version: 7.x-4.1 » 8.x-4.x-dev
Priority: Critical » Normal
Status: Active » Fixed
Issue tags: -stdClass::$sid, -Preview page, -Preview message

Please refer to the issue handbook for priorities. This is a normal issue, not critical.

There are actually collection of issues related to tokens, which I am bundling into one fix:

  1. A faux submission was always created for preview purposes, including preview token generation. When there is an actual submission, such as when save/autosave-as-draft or editing a previous submission has created a real submission, that submission should be used.
  2. When the faux submission was created, the sid was left uninitialized, rather than being set to NULL.
  3. When tokens are generated, the sid is not checked to be set before generating a serial, sid, url, or edit-url token and when the sid is NULL, an invalid token would be generated. Now an empty token is generated.
  4. The description for the [submission:url] token was misleading.
  5. The description for the [submission:edit-url] token was missing.
  6. Chained tokens for [submission:url] were generated even when the submission was NULL.
  7. Chained tokens for [submission:edit-url] (e.g. [submission:edit-url:absolute]) were not generated.

Committed to 7.x-4.x and 8.x.

  • DanChadwick committed 7e5ac70 on 7.x-4.x
    Issue #2376609 by DanChadwick: Fixed Notice: Undefined property:...
  • DanChadwick committed c6a4962 on 8.x-4.x
    Issue #2376609 by DanChadwick: Fixed Notice: Undefined property:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

danchadwick’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev