View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
17387Bug reportsSurvey participants (Tokens)public2021-07-05 09:57
ReporterMazi Assigned Togalads  
PrioritynoneSeverityblock 
Status closedResolutionfixed 
Product Version3.25.20 
Summary17387: Token placeholder from editor use invalid placeholders then do not get replaced at admin notification
Description

When using the placehlder icon from the editor to add placeholders like {FIRSTNAME} or {ATTRIBUTE_1}, these do NOT get replaced at the admin notification emails. Only syntax {TOKEN:value} works, see attached screenshots. The basic placeholders as the yget added when using the editor do not get replaced corectly.

Steps To Reproduce

Create a non-anonymous survey with tokens.
Add placeholder {FIRSTNAME} and placeholder {TOKEN:LASTNAME} to the admin notification email text.
Enter your email at the admin notification email field under "Notification & ...."
Activate and fill the survey.
Placeholder {FIRSTNAME} should NOT be replaced, only placeholder {TOKEN:LASTNAME}

TagsNo tags attached.
Attached Files
image.png (23,178 bytes)   
image.png (23,178 bytes)   
image-2.png (11,080 bytes)   
image-2.png (11,080 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)3.27.4+210622
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache
PHP Version7.2.26

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2021-06-23 17:37

developer   ~65029

The issue is in «When using the placeholder icon from the editor» right ?

Because « Placeholder {FIRSTNAME} should NOT be replaced, only placeholder {TOKEN:LASTNAME}»

Right ?

Mazi

Mazi

2021-06-23 17:41

updater   ~65030

Correct, the default placeholders like {FIRSTNAME} do not get replaced. Only syntax {TOKEN:FIRSTNAME} works.

DenisChenu

DenisChenu

2021-06-23 17:47

developer   ~65031

Token placeholder from editor use invalid placeholders then do not get replaced at admin notification

Long title ;)
https://manual.limesurvey.org/Email_templates#Email_Placeholders

ollehar

ollehar

2021-06-23 20:00

administrator   ~65034

Why shouldn't {FIRSTNAME} be replaced...?

DenisChenu

DenisChenu

2021-06-24 08:37

developer   ~65036

We are during survey … the question is why it should be replaced ?

  1. Anonymous survey
  2. Usage of FIRSTNAME question code in survey is possible.
  3. Because using {FIRSTNAME} in invitation and reminder are already an exception

Maybe best solution is to directly use {TOKEN:FIRSTNAME} in replacement ?

Mazi

Mazi

2021-06-24 11:58

updater   ~65040

Well, if the editor is offering a placeholder for first name and you can add it that way, then that should work. Currently it does not work.

Furthermore, if we can currently use the {TOKEN:FIRSTNAME} placeholder at emails for anonymous surveys, then we should keep that behavior. Because when changing this, we may break many running Limesurvey projects which may make use of this.
Same for using that placeholders at survey runtime. If it is curently supported, we can not suddenly change that. Many users will yell at us.

DenisChenu

DenisChenu

2021-06-24 12:20

developer   ~65041

In anonymous survey , in admin email : {TOKEN:FIRSTNAME} is replaced by a blank value :)

Else : my idea is to don't update anything on PHP part , but only on JS part : when : in the limereplacement field you select First Name : it put {TOKEN:FIRSTNAME} : because it work in all email.

https://github.com/LimeSurvey/LimeSurvey/blob/2cdd434cd03f33fa3a4f71add3000b6909611048/application/controllers/LimereplacementfieldsController.php#L321-L322

PS : strangely : it seems to be OK in 5.X : https://github.com/LimeSurvey/LimeSurvey/blob/2cdd434cd03f33fa3a4f71add3000b6909611048/application/controllers/LimereplacementfieldsController.php#L297-L298

DenisChenu

DenisChenu

2021-06-24 12:23

developer   ~65042

It's seems to be OK with popup html editor too ?

Peek 24-06-2021 12-22.gif (357,842 bytes)
DenisChenu

DenisChenu

2021-06-24 12:25

developer   ~65043

Same with HTML inline editor : select in Lime replacement fiels 'First name of this user" : {TOKEN:FIRSTNAME}
I can not reproduce the issue.

Mazi

Mazi

2021-06-24 12:30

updater   ~65044

Wow, VERY weird: I did another test using the default editor settings and selected the "first name from token" placeholder -> it was adding {FIRSTNAME}.

I then logged out and logged in using EN language because I wanted to create a screenshot for you. I selected the "first name from token" placeholder -> NOW it was adding {TOKEN:FIRSTNAME}.

I then logged out again and logged in using DE. I selected the "first name from token" placeholder -> NOW it was adding {TOKEN:FIRSTNAME} as well.

Could that be related to some caching and doing an update yesterday?

galads

galads

2021-06-28 14:16

reporter   ~65124

I can also not reproduce this issue. I jsut tested now.
Please give me feedback, I will like to close the report

Mazi

Mazi

2021-06-29 12:40

updater   ~65156

@DenisChenu, can the behavior described at my previous comment be caused by caching and updating?

@galads, I think we can close this for now.

DenisChenu

DenisChenu

2021-06-29 12:40

developer   ~65157

No idea

Issue History

Date Modified Username Field Change
2021-06-23 17:34 Mazi New Issue
2021-06-23 17:34 Mazi File Added: image.png
2021-06-23 17:34 Mazi File Added: image-2.png
2021-06-23 17:37 DenisChenu Note Added: 65029
2021-06-23 17:41 Mazi Note Added: 65030
2021-06-23 17:46 DenisChenu Summary Token placeholder do not get replaced at admin notification => Token placeholder from editor use invalid placeholders then do not get replaced at admin notification
2021-06-23 17:46 DenisChenu Description Updated
2021-06-23 17:46 DenisChenu Steps to Reproduce Updated
2021-06-23 17:47 DenisChenu Note Added: 65031
2021-06-23 20:00 ollehar Note Added: 65034
2021-06-24 08:37 DenisChenu Note Added: 65036
2021-06-24 11:58 Mazi Note Added: 65040
2021-06-24 12:20 DenisChenu Note Added: 65041
2021-06-24 12:23 DenisChenu Note Added: 65042
2021-06-24 12:23 DenisChenu File Added: Peek 24-06-2021 12-22.gif
2021-06-24 12:25 DenisChenu Note Added: 65043
2021-06-24 12:30 Mazi Note Added: 65044
2021-06-28 14:16 galads Note Added: 65124
2021-06-28 14:16 galads Assigned To => galads
2021-06-28 14:16 galads Status new => feedback
2021-06-29 12:40 Mazi Note Added: 65156
2021-06-29 12:40 Mazi Status feedback => assigned
2021-06-29 12:40 DenisChenu Note Added: 65157
2021-07-05 09:57 galads Status assigned => closed
2021-07-05 09:57 galads Resolution open => fixed