View Issue Details

This bug affects 1 person(s).
 14
IDProjectCategoryView StatusLast Update
04333Bug reportsSurvey takingpublic2010-05-21 19:05
Reporterwlodarczyk Assigned Tolemeur  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.87+ 
Fixed in Version1.90RC1 
Summary04333: "Previous" button, used from second question, gives SQL error when first question is hidden
Description

When the first question of a survey is a hidden question, such as is used to record data passed in via the URL, using the previous button from the second question (the first visible one) yields the following SQL error:


Notice: Undefined offset: -1 in /var/www/limesurvey/question.php on line 164
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 'group by type' at line 1:SELECT type FROM lime_questions WHERE qid= group by type

This occurs only when the survey is configured to present questions in question-by-question mode. It does not occur when the questions are presented group-by-group.

Steps To Reproduce
  • Import attached survey
  • Go to survey
  • Click "Next" to reach question "How now, brown cow?"
  • Click "Previous" from that question
  • SQL error will appear
TagsNo tags attached.
Attached Files
limesurvey_survey_89547.csv (5,230 bytes)   
# LimeSurvey Survey Dump
# DBVersion 142
# This is a dumped survey from the LimeSurvey Script
# http://www.limesurvey.org/
# Do not change this header!

#
# SURVEYS TABLE
#
"sid","owner_id","admin","active","expires","startdate","adminemail","private","faxto","format","template","language","additional_languages","datestamp","usecookie","notification","allowregister","allowsave","autonumber_start","autoredirect","allowprev","printanswers","ipaddr","refurl","datecreated","publicstatistics","publicgraphs","listpublic","htmlemail","tokenanswerspersistence","assessments","usecaptcha","usetokens","bounce_email","attributedescriptions","emailresponseto","tokenlength"
"89547","1","Your Name","N","","","walter@inspire.com","Y","","S","default","en","","N","N","0","N","Y","0","N","Y","N","N","N","2010-05-10","N","N","N","Y","N","N","D","N","walter@inspire.com","","","15"

#
# GROUPS TABLE
#
"gid","sid","group_name","group_order","description","language"
"17","89547","Test group","0","","en"

#
# QUESTIONS TABLE
#
"qid","sid","gid","type","title","question","preg","help","other","mandatory","lid","lid1","question_order","language"
"249","89547","17","S","hidden_question","This is a hidden question<br />","","","N","N","0","0","0","en"
"250","89547","17","L","not_hidden_question","How now, brown cow?<br />","","","N","Y","0","0","1","en"

#
# ANSWERS TABLE
#
"qid","code","answer","default_value","assessment_value","sortorder","language"
"250","n","No","N","0","2","en"
"250","y","Yes","N","0","1","en"

#
# CONDITIONS TABLE
#

#
# LABELSETS TABLE
#

#
# LABELS TABLE
#

#
# QUESTION_ATTRIBUTES TABLE
#
"qaid","qid","attribute","value"
"2573","249","display_rows",""
"2574","249","hidden","1"
"2575","249","maximum_chars",""
"2576","249","page_break","0"
"2577","249","text_input_width",""
"2578","249","time_limit",""
"2579","249","time_limit_action","1"
"2580","249","time_limit_message",""
"2581","249","time_limit_message_delay",""
"2582","249","time_limit_disable_next","0"
"2583","249","time_limit_message_style",""
"2584","249","time_limit_timer_style",""
"2585","249","time_limit_warning",""
"2586","249","time_limit_warning_display_time",""
"2587","249","time_limit_warning_message",""
"2588","249","time_limit_warning_style",""
"2590","250","hidden","0"
"2631","250","scale_export","0"
"2592","250","page_break","0"
"2630","250","random_order","0"
"2629","250","public_statistics","0"
"2628","250","other_replace_text",""
"2627","250","other_numbers_only","0"
"2626","250","other_comment_mandatory","0"
"2625","250","hide_tip","0"
"2624","250","display_columns","1"
"2623","250","array_filter_exclude",""
"2622","250","array_filter",""
"2621","250","alphasort","0"
"2634","249","suffix",""
"2633","249","prefix",""
"2632","249","numbers_only","0"

#
# ASSESSMENTS TABLE
#

#
# SURVEYS_LANGUAGESETTINGS TABLE
#
"surveyls_survey_id","surveyls_language","surveyls_title","surveyls_description","surveyls_welcometext","surveyls_endtext","surveyls_url","surveyls_urldescription","surveyls_email_invite_subj","surveyls_email_invite","surveyls_email_remind_subj","surveyls_email_remind","surveyls_email_register_subj","surveyls_email_register","surveyls_email_confirm_subj","surveyls_email_confirm","surveyls_dateformat"
"89547","en","A test survey","This is a test survey<br />","","<br />","","","Invitation to participate in survey","Dear {FIRSTNAME},<br /><br />You have been invited to participate in a survey.<br /><br />The survey is titled:<br />""{SURVEYNAME}""<br /><br />""{SURVEYDESCRIPTION}""<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}","Reminder to participate in survey","Dear {FIRSTNAME},<br /><br />Recently we invited you to participate in a survey.<br /><br />We note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.<br /><br />The survey is titled:<br />""{SURVEYNAME}""<br /><br />""{SURVEYDESCRIPTION}""<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}","Survey registration confirmation","Dear {FIRSTNAME},<br /><br />You, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.<br /><br />To complete this survey, click on the following URL:<br /><br />{SURVEYURL}<br /><br />If you have any questions about this survey, or if you did not register to participate and believe this email is in error, please contact {ADMINNAME} at {ADMINEMAIL}.","Confirmation of completed survey","Dear {FIRSTNAME},<br /><br />This email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.<br /><br />If you have any further questions about this email, please contact {ADMINNAME} at {ADMINEMAIL}.<br /><br />Sincerely,<br /><br />{ADMINNAME}","1"

#
# QUOTA TABLE
#

#
# QUOTA_MEMBERS TABLE
#

#
# QUOTA_LANGUAGESETTINGS TABLE
#

limesurvey_survey_89547.csv (5,230 bytes)   
Bug heat14
Complete LimeSurvey version number (& build)8518
I will donate to the project if issue is resolved
Browser
Database type & versionMySQL 5.0.51a-24+lenny3 (Debian)
Server OS (if known)Debian
Webserver software & version (if known)Apache
PHP Version5.2.6

Relationships

has duplicate 04337 closeduser372 Using the "Previous" button to go back to a hidden question crashes the app with SQL error 

Users monitoring this issue

wlodarczyk

Activities

Mazi

Mazi

2010-05-11 23:30

updater   ~11764

Last edited: 2010-05-11 23:31

I can reproduce the problem at the 1.90beta version (user used 1.87+) by following the instructions above, error message:
"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 'and parent_qid=0 group by type' at line 1:SELECT type FROM lime190_questions WHERE qid= and parent_qid=0 group by type"

It seems as if the qid is missing because the question is hidden?!

lemeur

lemeur

2010-05-12 23:35

developer   ~11799

should be fixed in rev8713.

lemeur

lemeur

2010-05-21 19:05

developer   ~11927

1.90 beta3 release

Issue History

Date Modified Username Field Change
2010-05-10 21:12 wlodarczyk New Issue
2010-05-10 21:12 wlodarczyk Status new => assigned
2010-05-10 21:12 wlodarczyk Assigned To => user372
2010-05-10 21:12 wlodarczyk File Added: limesurvey_survey_89547.csv
2010-05-10 21:12 wlodarczyk Issue Monitored: wlodarczyk
2010-05-11 23:30 Mazi Note Added: 11764
2010-05-11 23:30 Mazi Assigned To user372 => lemeur
2010-05-11 23:31 Mazi Note Edited: 11764
2010-05-12 22:11 lemeur Relationship added has duplicate 04337
2010-05-12 23:35 lemeur Note Added: 11799
2010-05-12 23:35 lemeur Status assigned => resolved
2010-05-12 23:35 lemeur Fixed in Version => 1.90RC1
2010-05-12 23:35 lemeur Resolution open => fixed
2010-05-21 19:05 lemeur Note Added: 11927
2010-05-21 19:05 lemeur Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking
2021-08-03 00:28 guest Bug heat 12 => 14