View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
06881Bug reportsSurvey participants (Tokens)public2012-11-16 10:40
ReporterpfpDave Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06881: SQL Error when sending e-mail invite from survey tokens/participants list
Description

When clicking on the envelope icon next to a user in the tokens table, an error similar to the one below appears (Where participant_ID is the ID of the participant):

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name '<Participant_ID>'.

To resolve the issue, change line 1451 in \application\controllers\admin\tokens.php from:

                            $slquery = Survey_links::model()->find('participant_id = "'.$emrow['participant_id'].'" AND survey_id = '.$iSurveyId.' AND token_id = '.$emrow['tid']);

to:

                            $slquery = Survey_links::model()->find('participant_id = \''.$emrow['participant_id'].'\' AND survey_id = '.$iSurveyId.' AND token_id = '.$emrow['tid']);

This replaces the double quotes for a column value to a single quote.

Additional Information

Database: SQL Express 2012

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)121115
I will donate to the project if issue is resolvedNo
BrowserIE8
Database type & versionSQL Express 2012
Server OS (if known)Server 2008
Webserver software & version (if known)IIS 7
PHP Version5.4.8

Users monitoring this issue

There are no users monitoring this issue.

Activities

pfpDave

pfpDave

2012-11-15 16:24

reporter   ~22189

Same issue at line 1061 of \application\helpers\frontend_helper.php

ie change

$slquery = Survey_links::model()->find('participant_id = "'.$participant_id.'" AND survey_id = '.$surveyid.' AND token_id = '.$token_id);

to

$slquery = Survey_links::model()->find('participant_id = \''.$participant_id.'\' AND survey_id = '.$surveyid.' AND token_id = '.$token_id);

to prevent an error on survey completion.

I'm wondering now if I'm missing something and there's some switch I've missed that should replace these on the fly if you're using a particular RDBMS??

c_schmitz

c_schmitz

2012-11-15 16:37

administrator   ~22191

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

c_schmitz

c_schmitz

2012-11-15 16:37

administrator   ~22192

Thank you!

c_schmitz

c_schmitz

2012-11-15 20:49

administrator   ~22209

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

c_schmitz

c_schmitz

2012-11-16 10:40

administrator   ~22244

New version 2.00+ Build 121116 released

Related Changesets

LimeSurvey: master 4c4879e0

2012-11-15 16:37

c_schmitz


Details Diff
Fixed issue 06881: SQL Error when sending e-mail invite from survey tokens/participants list and using MSSQL Affected Issues
06881
mod - application/controllers/admin/tokens.php Diff File
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: 2.1 67da66ad

2012-11-15 16:37

c_schmitz


Details Diff
Fixed issue 06881: SQL Error when sending e-mail invite from survey tokens/participants list and using MSSQL Affected Issues
06881
mod - application/controllers/admin/tokens.php Diff File
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-11-15 15:32 pfpDave New Issue
2012-11-15 16:24 pfpDave Note Added: 22189
2012-11-15 16:30 c_schmitz Assigned To => c_schmitz
2012-11-15 16:30 c_schmitz Status new => assigned
2012-11-15 16:37 c_schmitz Changeset attached => LimeSurvey master 4c4879e0
2012-11-15 16:37 c_schmitz Note Added: 22191
2012-11-15 16:37 c_schmitz Resolution open => fixed
2012-11-15 16:37 c_schmitz Note Added: 22192
2012-11-15 16:37 c_schmitz Status assigned => resolved
2012-11-15 16:37 c_schmitz Fixed in Version => 2.00+
2012-11-15 20:49 c_schmitz Changeset attached => LimeSurvey 2.1 67da66ad
2012-11-15 20:49 c_schmitz Note Added: 22209
2012-11-16 10:40 c_schmitz Note Added: 22244
2012-11-16 10:40 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)