View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
07191Bug reportsSurvey participants (Tokens)public2013-03-02 16:34
ReporterpfpDave Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary07191: Surey links not deleted when deactivating survey? - Error when adding a token to a survey that has previously had a token table
Description

Suspect Survey links not removed when survey deactivated looking as SQL? See steps to reproduce to see issue

Steps To Reproduce

Create Survey
goto CPD
search for CPD entry
Tick select box next to CPD entry
Click Add to survey
Select survey
Remove checkmark against 'Display Survey Tokens after adding?'
Click 'Next'
Click continue on attribute mapping screen
Goto Survey
activate survey (switch to closed access mode)
Deactivate survey
Create new token table (TOkens --> Initialise tokens)
goto CPD
search for same CPD entry
Tick select box next to CPD entry
Click Add to survey
Select survey
Remove checkmark against 'Display Survey Tokens after adding?'
Click 'Next'
Click continue on attribute mapping screen
Goto Survey
Delete Token table

Error returned:

<h1>CDbException</h1>
<p>CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__survey_l__242D72FDE35AC69C'. Cannot insert duplicate key in object 'dbo.survey_links'. The duplicate key value is (6d4553a4-a2f0-49f4-83c3-30619a8fda5b, 2, 816272).. The SQL statement executed was: INSERT INTO [survey_links] ([participant_id], [token_id], [survey_id], [date_created]) VALUES (:participant_id, :token_id, :survey_id, :date_created) (C:\limesurvey\framework\db\CDbCommand.php:354)</p><pre>#0 C:\limesurvey\framework\db\CDbCommand.php(1178): CDbCommand->execute(Array)
#1 C:\limesurvey\application\models\Participants.php(1081): CDbCommand->insert('{{survey_links}...', Array)
#2 C:\limesurvey\application\controllers\admin\participantsaction.php(1540): Participants->copytosurveyatt('816272', '', Array, '6d4553a4-a2f0-4...', 'false', 'false', 'false', 'false')
#3 [internal function]: participantsaction->addToTokenattmap()
#4 C:\limesurvey\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(participantsaction), Array)
#5 C:\limesurvey\application\core\Survey_Common_Action.php(100): CAction->runWithParamsInternal(Object(participantsaction), Object(ReflectionMethod), Array)
#6 C:\limesurvey\application\controllers\admin\participantsaction.php(51): Survey_Common_Action->runWithParams(Array)
#7 C:\limesurvey\framework\web\CController.php(309): participantsaction->runWithParams(Array)
#8 C:\limesurvey\framework\web\CController.php(287): CController->runAction(Object(participantsaction))
#9 C:\limesurvey\framework\web\CController.php(266): CController->runActionWithFilters(Object(participantsaction), Array)
#10 C:\limesurvey\application\controllers\AdminController.php(169): CController->run('participants')
#11 C:\limesurvey\framework\web\CWebApplication.php(276): AdminController->run('participants')
#12 C:\limesurvey\framework\web\CWebApplication.php(135): CWebApplication->runController('admin/participa...')
#13 C:\limesurvey\framework\base\CApplication.php(162): CWebApplication->processRequest()
#14 C:\limesurvey\index.php(178): CApplication->run()
#15 {main}</pre>

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)130108
I will donate to the project if issue is resolvedNo
BrowserFirefox 18
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

c_schmitz

c_schmitz

2013-02-22 22:02

administrator   ~24206

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

c_schmitz

c_schmitz

2013-02-26 20:03

administrator   ~24417

New version released.

c_schmitz

c_schmitz

2013-03-02 16:34

administrator   ~24481

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

Related Changesets

LimeSurvey: master 046f1ba4

2013-02-22 21:02:43

c_schmitz

Details Diff
Fixed issue 07191: Survey links not deleted when deactivating a survey Affected Issues
07191
mod - application/controllers/admin/surveyadmin.php Diff File
mod - application/models/Survey.php Diff File

LimeSurvey: 2.1 4db3f66d

2013-02-22 21:02:43

c_schmitz

Details Diff
Fixed issue 07191: Survey links not deleted when deactivating a survey Affected Issues
07191
mod - application/controllers/admin/surveyadmin.php Diff File
mod - application/models/Survey.php Diff File

Issue History

Date Modified Username Field Change
2013-01-15 10:41 pfpDave New Issue
2013-01-18 23:37 c_schmitz Assigned To => c_schmitz
2013-01-18 23:37 c_schmitz Status new => assigned
2013-01-22 13:57 c_schmitz Assigned To c_schmitz => jcleeland
2013-02-22 22:02 c_schmitz Assigned To jcleeland => c_schmitz
2013-02-22 22:02 c_schmitz Status assigned => resolved
2013-02-22 22:02 c_schmitz Fixed in Version => 2.00+
2013-02-22 22:02 c_schmitz Resolution open => fixed
2013-02-22 22:02 c_schmitz Changeset attached => LimeSurvey master 046f1ba4
2013-02-22 22:02 c_schmitz Note Added: 24206
2013-02-26 20:03 c_schmitz Note Added: 24417
2013-02-26 20:03 c_schmitz Status resolved => closed
2013-03-02 16:34 c_schmitz Changeset attached => LimeSurvey 2.1 4db3f66d
2013-03-02 16:34 c_schmitz Note Added: 24481
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)