Get token in completed/submit.twig template

More
1 week 2 days ago #180135 by webmasterlee
Hi,

We just upgraded from Lime 2.67.1 to 3.15.6. We display a form on the completed page of the template which submits to another domain and passes the token in the form.

Previously we simply added {token} to the form but this no longer works with the new system. I've searched the manual and forum but could not find a way to output the token in the template. I'm sure I'm overlooking something simple.

Thoughts?

Thanks,
Alex

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180147 by DenisChenu
All template are not Expression Managed now, it use twig.


In the twig file : you must use this function github.com/LimeSurvey/LimeSurvey/blob/ma...g_Extension.php#L429
{{ processString("{TOKEN}") }}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: LouisGac

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180169 by webmasterlee
Thanks for your reply. It doesn't output anything in submit.twig. I tried putting it in layout_global.twig to test and it outputs the token on the first page of the survey only. Every other page it was empty.

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180172 by DenisChenu
Can you try in question.twig with {{ processString("{TOKEN:TOKEN}") }} ?

What is your version number ? github.com/LimeSurvey/LimeSurvey/commit/...9dce52f005d2664f3dfb

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180175 by webmasterlee
Version 3.15.6+190108

{{ processString("{TOKEN:TOKEN}") }} works for every page (including question.twig) except the last completed page.

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180176 by jelo

DenisChenu wrote: Can you try in question.twig with {{ processString("{TOKEN:TOKEN}") }} ?

Why did that change? Who has the real overview and can provide a uptodate variable sheet.
If TOKEN is now TOKEN:TOKEN, what is the correct syntax to access a token attribute.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180184 by DenisChenu
TOKEN:TOKEN came from Expression Manager knowVars
TOKEN come from template replace static vars

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: LouisGac

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180186 by DenisChenu
For last completed page : update to 3.15.7 or up.

For TOKEN : i update the close the original issue and create a new one

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: webmasterlee

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180196 by webmasterlee
Thank you all. I upgraded to the latest version 3.15.8+190130 and both {{ processString("{TOKEN}") }} and {{ processString("{TOKEN:TOKEN}") }} work.

Please Identificarse or Create an account to join the conversation.

More
1 week 2 days ago #180197 by DenisChenu
Arg : i test for TOKEN : and it seem‘s it don't work in all twig : bugs.limesurvey.org/view.php?id=14507

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Identificarse or Create an account to join the conversation.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión