View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
18786Bug reportsSurvey participants (Tokens)public2023-05-02 10:20
ReporterMazi Assigned Toc_schmitz  
PrioritynoneSeverityblock 
Status closedResolutionfixed 
Product Version5.6.x 
Summary18786: Wrong token length check, update from 2.x to 5.x causes problems
Description

We have updated an old 2.0x system to the latest 5.x version. At the old system the token length was set to 36.
When now opening the participant settings and changing a certain detail, we always get the following error:
"Survey could not be updated, please fix the following error:
Tokenlength is too big (maximum is 35)."

The token length shows the old value from v2.0x which is 36. The token column at the DB is defined as VARCHAR(36) after the update. We can also create new tokens and dummy tokens with the token length of 36. But we can not save the participant setting. From my point of view the limit has to be 36 and not 35.

Steps To Reproduce

Steps to reproduce

Try to set a token length of 36.

Expected result

Accepts 36 as maximum value.

Actual result

Error message "Survey could not be updated, please fix the following error:
Tokenlength is too big (maximum is 35)."

TagsNo tags attached.
Attached Files
image.png (36,313 bytes)   
image.png (36,313 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)5.6.x
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache
PHP VersionPHP 7.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2023-04-25 13:53

updater   ~74626

@DenisChenu, do you agree that the field validation is wrong and token length allowed maximum should be 36?!

c_schmitz

c_schmitz

2023-04-25 14:32

administrator   ~74627

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34524

c_schmitz

c_schmitz

2023-04-25 14:49

administrator   ~74629

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34525

c_schmitz

c_schmitz

2023-04-25 14:54

administrator   ~74634

I am not sure if this could become a issue in the future again, IF there maybe were token tables created which had only a field length of 35 characters. We will see, I guess.

Mazi

Mazi

2023-04-25 15:28

updater   ~74637

@c_schmitz, thanks a lot for the very quick fix.

Just for your information: At the migrated DB with >200 surveys some had a token length defined of 60. That passed the DB migration which is one potential error. It also leads to errors when generating new tokens. Error I get is:
"500: Internal Server Error
Failed to create unique access code in 50 attempts."

We fixed this by a DB update and setting these to a max length of 36.

LimeBot

LimeBot

2023-05-02 10:20

administrator   ~74737

Fixed in Release 6.0.5+230502

Related Changesets

LimeSurvey: master 24cfac42

2023-04-25 14:31:44

c_schmitz

Details Diff
Fixed issue 18786: Error shown when token length is set to 36 characters Affected Issues
18786
mod - application/controllers/admin/Database.php Diff File
mod - application/helpers/admin/import_helper.php Diff File
mod - application/models/Survey.php Diff File

LimeSurvey: 5.x 19bf0d52

2023-04-25 14:31:44

c_schmitz

Details Diff
Fixed issue 18786: Error shown when token length is set to 36 characters Affected Issues
18786
mod - application/controllers/admin/Database.php Diff File
mod - application/helpers/admin/import_helper.php Diff File
mod - application/models/Survey.php Diff File

Issue History

Date Modified Username Field Change
2023-04-25 12:01 Mazi New Issue
2023-04-25 12:01 Mazi File Added: image.png
2023-04-25 13:53 Mazi Note Added: 74626
2023-04-25 13:53 Mazi Bug heat 0 => 2
2023-04-25 14:31 DenisChenu Assigned To => DenisChenu
2023-04-25 14:31 DenisChenu Status new => assigned
2023-04-25 14:32 c_schmitz Changeset attached => LimeSurvey master 24cfac42
2023-04-25 14:32 c_schmitz Note Added: 74627
2023-04-25 14:32 c_schmitz Bug heat 2 => 4
2023-04-25 14:32 c_schmitz Assigned To DenisChenu => c_schmitz
2023-04-25 14:32 c_schmitz Resolution open => fixed
2023-04-25 14:49 c_schmitz Changeset attached => LimeSurvey 5.x 19bf0d52
2023-04-25 14:49 c_schmitz Note Added: 74629
2023-04-25 14:53 c_schmitz Status assigned => resolved
2023-04-25 14:54 c_schmitz Note Added: 74634
2023-04-25 15:28 Mazi Note Added: 74637
2023-05-02 10:20 LimeBot Note Added: 74737
2023-05-02 10:20 LimeBot Status resolved => closed
2023-05-02 10:20 LimeBot Bug heat 4 => 6