View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 20457 | Bug reports | Survey participants (Tokens) | public | 2026-03-13 11:58 | 2026-03-13 12:01 |
| Reporter | riku | Assigned To | |||
| Priority | none | Severity | crash | ||
| Status | new | Resolution | open | ||
| Product Version | 6.16.x | ||||
| Summary | 20457: tableExists helper function returns outdated result due to cache | ||||
| Description | We ran into the issue where on survey activation with closed-access mode and public registration allowed, a database error was thrown if the survey had been activated in open access mode previously. The database error stated that the finaltokens table already existed. Digging deeper, the SurveyAccessModeService->newParticipantTable method was called twice under these exact conditions, once via SurveyActivate->activate and once via SurveyAccessModeService->changeAccessMode. Obviously on the second call the table already existed and $survey->hasTokensTable should have caught that, but no. So long story short, the tableExists helper in application/helpers/common_helper.php used cached results on the second call, meaning $survey->hasTokensTable was still false and an unsuccessful attempt was made to create the finaltokens table once more. | ||||
| Steps To Reproduce | Steps to reproduce
Expected resultSurvey is activated without errors on the second attempt. Actual resultSurvey activation causes a database error. | ||||
| Tags | No tags attached. | ||||
| Bug heat | 2 | ||||
| Complete LimeSurvey version number (& build) | 6.16.12+26030 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | - | ||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | 8.3 | ||||