LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
04894Bug reports[All Projects] Response browsingpublic2011-01-22 08:472011-01-26 22:10
Reporterstarmonkey 
Assigned ToDenisChenu 
PriorityhighSeveritycrash 
StatusclosedResolutionfixed 
Product Version1.91RC2 
Target VersionFixed in Version1.91RC3 
Summary04894: Changing "display" to "Completed responses only" = SQL syntax error
DescriptionAs per the summary. Admin cannot proceed once this issue is triggered.
Steps To Reproduce1) Go to browse a survey's responses
2) Change display to "completed responses only"
3) System fails with an SQL error that's not recoverable:

Couldn't pull response data
SELECT count(*) FROM `lime_survey_18513` submitdate IS NOT NULL
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT NULL' at line 1
Additional InformationI fixed it by adding a line to admin/browse.php:

$sql_where = "";
if (incompleteAnsFilterstate() == "inc")
{
  $sql_where .= "submitdate IS NULL";
}
elseif (incompleteAnsFilterstate() == "filter")
{
  $sql_where .= "submitdate IS NOT NULL";
}

// SM 22Jan11: Fix to add WHERE clause if needed.
if($sql_where != "") { $sql_where = "WHERE ".$sql_where; }

//LETS COUNT THE DATA
$dtquery = "SELECT count(*) FROM $sql_from $sql_where";

$dtresult=db_execute_num($dtquery) or safe_die("Couldn't pull response data
{$dtquery}
".$connect->ErrorMsg());

I generally prefer generating sql in more robust methods, but that's my quick fix.
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID191
BrowserFirefox, Chrome
Database & DB-VersionMySQL5
Operating System (Server)Ubuntu 10.04
Webserver software & versionApache2
PHP VersionPHP5
Attached Files

- Relationships
related to 04929closedlemeur crash by pressing "show answers" in "answers and statistics" 

-  Notes
User avatar (13954)
starmonkey (reporter)
2011-01-22 09:12

Note the build is Version 1.91RC2 Build 9672 (latest download)
User avatar (13957)
DenisChenu (developer)
2011-01-22 19:01

Thanks !

Fixed with:
    if ($sql_where!="")
    {
        $dtquery .=" WHERE $sql_where";
    }

:)

http://limesurvey.svn.sourceforge.net/viewvc/limesurvey?view=revision&revision=9711 [^]
User avatar (13968)
c_schmitz (administrator)
2011-01-26 22:10

Released.

- Issue History
Date Modified Username Field Change
2011-01-22 08:47 starmonkey New Issue
2011-01-22 09:12 starmonkey Note Added: 13954
2011-01-22 18:55 DenisChenu Assigned To => DenisChenu
2011-01-22 18:55 DenisChenu Status new => assigned
2011-01-22 18:58 DenisChenu Note Added: 13956
2011-01-22 18:58 DenisChenu Status assigned => resolved
2011-01-22 18:58 DenisChenu Fixed in Version => 1.91RC3
2011-01-22 18:58 DenisChenu Resolution open => fixed
2011-01-22 19:01 DenisChenu Note Deleted: 13956
2011-01-22 19:01 DenisChenu Note Added: 13957
2011-01-26 22:10 c_schmitz Note Added: 13968
2011-01-26 22:10 c_schmitz Status resolved => closed
2011-03-01 11:58 DenisChenu Relationship added related to 04929


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker