View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
06889 | Bug reports | Survey participants (Tokens) | public | 2012-11-16 13:02 | 2012-11-27 06:11 |
Reporter | pfpDave | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.00+ | ||||
Fixed in Version | 2.00+ | ||||
Summary | 06889: Clicking view participants in central participant list from a survey gives error CDbException (Error 500) | ||||
Description | When in the participant list of a survey, clicking on the button at the bottom of the list 'View participants of this survey in the central participant database panel' gives the error 'CDbException (Error 500) Debug mode gives no further information, however tracing through the code I've managed to determine that the code enters the block of code at \application\models\participants.php line 512 then moves to the block at line 634 at which point it fails. I've not been able to extract the final converted contents of the $command object but I suspect the error is in the SQL query formed. The $command->condition looks like this at the point before it enters the block at line 634: participant_id IN (SELECT distinct {{survey_links}}.participant_id FROM {{survey_links}}, {{surveys_languagesettings}} WHERE {{survey_links}}.survey_id = {{surveys_languagesettings}}.surveyls_survey_id AND {{surveys_languagesettings}}.surveyls_language=:lang AND ({{surveys_languagesettings}}.surveyls_title = :param2 OR {{survey_links}}.survey_id = :param2)) | ||||
Tags | No tags attached. | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 121115 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | IE8 | ||||
Database type & version | SQL Express 2012 | ||||
Server OS (if known) | Server 2008 | ||||
Webserver software & version (if known) | IIS 7 | ||||
PHP Version | 5.4.8 | ||||
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10333 |
|
I've just downloaded the new Participants.php file and I get the same issue (CDbException (Error 500) Could not process your query.) on my installation ... don't know if I should or not ... appologies if you would expect this. |
|
I checked again and it works just fine. Make sure that you download the right file, replace it correctly and clean your browser cache. |
|
Just tested again and still no joy ... steps to reproduce:
|
|
Maybe you can trace again and check if the issue moved somewhere else? |
|
OK just done a simple check (print text and exit) and the code seems to be failing at line 634 $arr = Participants::model()->findAll($command); I'm afraid I've only got primitive dev tools on this laptop but if you have something specific you'd like me to try I'd be more than happy to. |
|
ok, can you check what the contents of $command->toArray() is ? do a var_dump($command->toArray()); die() |
|
array(15) { ["select"]=> string(1) "*" ["condition"]=> string(359) "participant_id IN (SELECT distinct {{survey_links}}.participant_id FROM {{survey_links}}, {{surveys_languagesettings}} WHERE {{survey_links}}.survey_id = {{surveys_languagesettings}}.surveyls_survey_id AND {{surveys_languagesettings}}.surveyls_language=:lang AND ({{surveys_languagesettings}}.surveyls_title = :param1 OR {{survey_links}}.survey_id = :param2))" ["params"]=> array(3) { [":lang"]=> string(2) "en" [":param1"]=> int(489924) [":param2"]=> int(489924) } ["limit"]=> string(2) "25" ["offset"]=> int(0) ["order"]=> string(0) "" ["group"]=> string(0) "" ["join"]=> string(0) "" ["having"]=> string(0) "" ["distinct"]=> bool(false) ["scopes"]=> NULL ["with"]=> NULL ["alias"]=> NULL ["index"]=> NULL ["together"]=> NULL } |
|
Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10348 |
|
Should there be a new version of the file from the 18th?? I've just grabbed the latest one from here: http://github.com/LimeSurvey/LimeSurvey/tree/8fca43738201e737c3688b269d048aec7b31ca5a/application/models/Participants.php and the issue still exists. The contents of $command->toArray() are below if this helps: array(15) { ["select"]=> string(1) "*" ["condition"]=> string(359) "participant_id IN (SELECT distinct {{survey_links}}.participant_id FROM {{survey_links}}, {{surveys_languagesettings}} WHERE {{survey_links}}.survey_id = {{surveys_languagesettings}}.surveyls_survey_id AND {{surveys_languagesettings}}.surveyls_language=:lang AND ({{surveys_languagesettings}}.surveyls_title = :param1 OR {{survey_links}}.survey_id = :param2))" ["params"]=> array(3) { [":lang"]=> string(2) "en" [":param1"]=> int(378628) [":param2"]=> int(378628) } ["limit"]=> string(2) "25" ["offset"]=> int(0) ["order"]=> string(0) "" ["group"]=> string(0) "" ["join"]=> string(0) "" ["having"]=> string(0) "" ["distinct"]=> bool(false) ["scopes"]=> NULL ["with"]=> NULL ["alias"]=> NULL ["index"]=> NULL ["together"]=> NULL } |
|
I am sorry but I cannot reproduce the issue. The parameter array looks fine to me, too. Can you try to manually cobble a statement together from that contents and see if there are any problems executing that statement? |
|
Rather than my trying to guess is there a place where I can intercept the formed SQL statement before it's executed? |
|
Do you have Firefix and Firebug installed? If yes you can activate the new parameter in the latest version in config.php and it would appear in the Firebug console. |
|
Got it! Here's the SQL it's trying to execute. CDbCommand failed to execute the SQL statement: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the varchar value 'Test Large Survey' to data type int.. The SQL statement executed was: SELECT TOP 25 * FROM [dbo].[participants] [t] WHERE participant_id IN (SELECT distinct survey_links.participant_id FROM survey_links, surveys_languagesettings WHERE survey_links.survey_id = surveys_languagesettings.surveyls_survey_id AND surveys_languagesettings.surveyls_language=:lang AND (surveys_languagesettings.surveyls_title = :param1 OR survey_links.survey_id = :param2)) (C:\limesurvey\framework\db\CDbCommand.php:528) and here's the full error text: <h1>CDbException</h1> CDbCommand failed to execute the SQL statement: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the varchar value 'Test Large Survey' to data type int.. The SQL statement executed was: SELECT TOP 25 * FROM [dbo].[participants] [t] WHERE participant_id IN (SELECT distinct survey_links.participant_id FROM survey_links, surveys_languagesettings WHERE survey_links.survey_id = surveys_languagesettings.surveyls_survey_id AND surveys_languagesettings.surveyls_language=:lang AND (surveys_languagesettings.surveyls_title = :param1 OR survey_links.survey_id = :param2)) (C:\limesurvey\framework\db\CDbCommand.php:528) #0 C:\limesurvey\framework\db\CDbCommand.php(390): CDbCommand->queryInternal('fetchAll', Array, Array) |
|
Thank you - that helped. Hope this fix does the trick. |
|
Fix committed to 2.0 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=10382 |
|
This seems to have resolved the issue, many thanks. |
|
New 2.00+ build released. |
|
LimeSurvey: master 1b431ec5 2012-11-16 13:42 Details Diff |
Fixed issue 06889: Clicking view participants in central participant list from a survey gives error in MSSQL |
Affected Issues 06889 |
|
mod - application/models/Participants.php | Diff File | ||
LimeSurvey: 2.1 8fca4373 2012-11-16 13:42 Details Diff |
Fixed issue 06889: Clicking view participants in central participant list from a survey gives error in MSSQL |
Affected Issues 06889 |
|
mod - application/models/Participants.php | Diff File | ||
LimeSurvey: master e3d0b5a5 2012-11-20 17:05 Details Diff |
Fixed issue 06889: Clicking view participants in central participant list from a survey gives error in MSSQL |
Affected Issues 06889 |
|
mod - application/models/Participants.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-11-16 13:02 | pfpDave | New Issue | |
2012-11-16 13:41 | c_schmitz | Assigned To | => c_schmitz |
2012-11-16 13:41 | c_schmitz | Status | new => assigned |
2012-11-16 13:42 | c_schmitz | Changeset attached | => LimeSurvey master 1b431ec5 |
2012-11-16 13:42 | c_schmitz | Note Added: 22268 | |
2012-11-16 13:42 | c_schmitz | Resolution | open => fixed |
2012-11-16 13:42 | c_schmitz | Status | assigned => resolved |
2012-11-16 13:42 | c_schmitz | Fixed in Version | => 2.00+ |
2012-11-16 13:59 | pfpDave | Note Added: 22269 | |
2012-11-16 16:10 | c_schmitz | Note Added: 22281 | |
2012-11-16 16:35 | pfpDave | Note Added: 22284 | |
2012-11-16 16:41 | c_schmitz | Note Added: 22285 | |
2012-11-16 16:45 | pfpDave | Note Added: 22288 | |
2012-11-16 16:53 | c_schmitz | Note Added: 22289 | |
2012-11-16 16:53 | c_schmitz | Note Edited: 22289 | |
2012-11-16 17:01 | pfpDave | Note Added: 22290 | |
2012-11-16 21:48 | c_schmitz | Status | resolved => closed |
2012-11-18 18:51 | c_schmitz | Changeset attached | => LimeSurvey 2.1 8fca4373 |
2012-11-18 18:51 | c_schmitz | Note Added: 22305 | |
2012-11-19 10:07 | pfpDave | Note Added: 22310 | |
2012-11-19 10:07 | pfpDave | Status | closed => feedback |
2012-11-19 10:07 | pfpDave | Resolution | fixed => reopened |
2012-11-20 15:53 | c_schmitz | Note Added: 22340 | |
2012-11-20 15:58 | pfpDave | Note Added: 22343 | |
2012-11-20 15:58 | pfpDave | Status | feedback => assigned |
2012-11-20 16:02 | c_schmitz | Note Added: 22344 | |
2012-11-20 16:42 | pfpDave | Note Added: 22346 | |
2012-11-20 16:43 | pfpDave | Note Edited: 22346 | |
2012-11-20 16:50 | pfpDave | Note Edited: 22346 | |
2012-11-20 17:06 | c_schmitz | Note Added: 22348 | |
2012-11-20 17:07 | c_schmitz | Changeset attached | => LimeSurvey master e3d0b5a5 |
2012-11-20 17:08 | c_schmitz | Note Added: 22349 | |
2012-11-20 17:08 | c_schmitz | Status | assigned => resolved |
2012-11-20 17:08 | c_schmitz | Resolution | reopened => fixed |
2012-11-21 10:49 | pfpDave | Note Added: 22361 | |
2012-11-27 06:11 | c_schmitz | Note Added: 22594 | |
2012-11-27 06:11 | c_schmitz | Status | resolved => closed |
2016-12-08 10:39 | c_schmitz | Category | Tokens => Survey participants (Tokens) |