View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
20588Bug reportsSurvey participants (Tokens)public2026-08-03 16:09
Reportertademo Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionunable to reproduce 
Product Version6.17.x 
Summary20588: Error while import participants for csv file
Description

Error while import participants for csv file

Invalid access codes skipped when the token field is filled in

for example:

tid,firstname,lastname,email,emailstatus,token,language,validfrom,validuntil,invited,reminded,remindercount,completed,usesleft
"1","first","last","first.last@gmail.com","OK","DIOnqyPDjZJPDws","pl","","","N","N","0","N","1"

When the token field is empty import executes successfully.

Steps To Reproduce

Steps to reproduce

open survey
click participants
click add button (3 dots)
Import participants from: CSV file
choice csv file
click upload

Expected result

add a participant with a token as well

Actual result

1 lines with invalid access codes skipped (access codes may only contain 0-9,a-z,A-Z,_). [List]

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)LimeSurvey Community Edition Version 6.17.10+260622
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql 8.2
Server OS (if known)
Webserver software & version (if known)
PHP Version8.2
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

tademo

tademo

2026-07-17 12:34

reporter   ~85210

I have applied a temporary fix for the participants token import/editing error.
In the file application/models/Token.php, I commented out lines 318 and 319 and added an entry.
My code now looks like this:

    // According to Yii doc : http://www.yiiframework.com/doc/api/1.1/CSecurityManager#generateRandomString-detail

$pattern = Yii::app()->getConfig("allowedcharacters_pattern_token");

return preg_replace($pattern, '', $token);

    return preg_replace('/[^A-Za-z0-9_]/', '', (string)$token);

I am awaiting the official fix.

tademo

tademo

2026-07-22 12:04

reporter   ~85247

A similar issue (20587) was already closed before I could comment, so I am posting my comment here.
The problem was on my end because, during manual upgrades, I always copied the old config-defaults.php file along with config.php and security.php, so I didn't have the latest changes.
Thanks to Haythem for the advice below :
2026-07-22 09:57
developer 20587:85238
Hi,
Most likely you're missing a config in your application/config/config-defaults.php

$config['allowedcharacters_patterntoken'] = '/[^0-9a-zA-Z-~]/';
If it's not there, just add it, that's most likely what's causing the empty token issue. Let us know how it goes !

You can close my issue.

Issue History

Date Modified Username Field Change
2026-07-01 10:28 tademo New Issue
2026-07-17 12:34 tademo Note Added: 85210
2026-07-17 12:34 tademo Bug heat 0 => 2
2026-07-22 12:04 tademo Note Added: 85247
2026-08-03 16:09 c_schmitz Assigned To => c_schmitz
2026-08-03 16:09 c_schmitz Status new => closed
2026-08-03 16:09 c_schmitz Resolution open => unable to reproduce