View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
10225Bug reportsImport/Exportpublic2016-01-22 08:54
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.06+ 
Fixed in Version2.06+ 
Summary10225: Import TSV can broke DB
Description

When importing a survey with 2 times same question title : it broke with
CDbCommand n'a pas pu exécuter la commande SQL : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '50304--en-0-0' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO lime_defaultvalues (qid, language, defaultvalue) VALUES (:yp0, :yp1, :yp2)

Steps To Reproduce

Try to import included file :) : one cquestion , just copy it after (then same question 2 times).

Additional Information

There are more bug here :
1st : we don't use save/try for TSV default value : here is the bug shown here
2nd we import 'empty' default value
3rd : TSV import system return array for error : we try to show it as string : broke with debug > 0

TagsNo tags attached.
Attached Files
limesurvey_survey_332646.txt (14,475 bytes)   
class	type/scale	name	relevance	text	help	language	validation	mandatory	other	default	same_default	allowed_filetypes	alphasort	answer_width	array_filter	array_filter_exclude	array_filter_style	assessment_value	category_separator	choice_title	code_filter	commented_checkbox	commented_checkbox_auto	date_format	date_max	date_min	display_columns	display_rows	dropdown_dates	dropdown_dates_minute_step	dropdown_dates_month_style	dropdown_prefix	dropdown_prepostfix	dropdown_separators	dropdown_size	dualscale_headerA	dualscale_headerB	em_validation_q	em_validation_q_tip	em_validation_sq	em_validation_sq_tip	equals_num_value	exclude_all_others	exclude_all_others_auto	hidden	hide_tip	input_boxes	location_city	location_country	location_defaultcoordinates	location_mapheight	location_mapservice	location_mapwidth	location_mapzoom	location_nodefaultfromip	location_postal	location_state	max_answers	max_filesize	max_num_of_files	max_num_value	max_num_value_n	maximum_chars	min_answers	min_num_of_files	min_num_value	min_num_value_n	multiflexible_checkbox	multiflexible_max	multiflexible_min	multiflexible_step	num_value_int_only	numbers_only	other_comment_mandatory	other_numbers_only	other_replace_text	page_break	parent_order	prefix	printable_help	public_statistics	random_group	random_order	rank_title	repeat_headings	reverse	samechoiceheight	samelistheight	scale_export	show_comment	show_grand_total	show_title	show_totals	showpopups	slider_accuracy	slider_default	slider_layout	slider_max	slider_middlestart	slider_min	slider_rating	slider_reset	slider_separator	slider_showminmax	statistics_graphtype	statistics_showgraph	statistics_showmap	suffix	text_input_width	time_limit	time_limit_action	time_limit_countdown_message	time_limit_disable_next	time_limit_disable_prev	time_limit_message	time_limit_message_delay	time_limit_message_style	time_limit_timer_style	time_limit_warning	time_limit_warning_2	time_limit_warning_2_display_time	time_limit_warning_2_message	time_limit_warning_2_style	time_limit_warning_display_time	time_limit_warning_message	time_limit_warning_style	thousands_separator	use_dropdown
S		sid		332646																																																																																																																												
S		owner_id		1																																																																																																																												
S		admin		Denis Chenu																																																																																																																												
S		active		N																																																																																																																												
S		adminemail		denis@sondages.pro																																																																																																																												
S		anonymized		N																																																																																																																												
S		format		G																																																																																																																												
S		savetimings		N																																																																																																																												
S		template		skeletonquest																																																																																																																												
S		language		en																																																																																																																												
S		datestamp		N																																																																																																																												
S		usecookie		N																																																																																																																												
S		allowregister		N																																																																																																																												
S		allowsave		Y																																																																																																																												
S		autonumber_start		0																																																																																																																												
S		autoredirect		N																																																																																																																												
S		allowprev		N																																																																																																																												
S		printanswers		N																																																																																																																												
S		ipaddr		N																																																																																																																												
S		refurl		N																																																																																																																												
S		datecreated		2016-01-13																																																																																																																												
S		publicstatistics		N																																																																																																																												
S		publicgraphs		N																																																																																																																												
S		listpublic		N																																																																																																																												
S		htmlemail		N																																																																																																																												
S		sendconfirmation		Y																																																																																																																												
S		tokenanswerspersistence		N																																																																																																																												
S		assessments		N																																																																																																																												
S		usecaptcha		N																																																																																																																												
S		usetokens		N																																																																																																																												
S		bounce_email		noreply@sondages.pro																																																																																																																												
S		tokenlength		15																																																																																																																												
S		showxquestions		Y																																																																																																																												
S		showgroupinfo		B																																																																																																																												
S		shownoanswer		Y																																																																																																																												
S		showqnumcode		X																																																																																																																												
S		bounceprocessing		N																																																																																																																												
S		showwelcome		Y																																																																																																																												
S		showprogress		Y																																																																																																																												
S		navigationdelay		0																																																																																																																												
S		nokeyboard		N																																																																																																																												
S		alloweditaftercompletion		N																																																																																																																												
S		questionindex		0																																																																																																																												
SL		surveyls_title		TSV broken		en																																																																																																																										
SL		surveyls_email_invite_subj		Invitation to participate in a survey		en																																																																																																																										
SL		surveyls_email_invite		"Dear {FIRSTNAME},  you have been invited to participate in a survey.  The survey is titled: ""{SURVEYNAME}""  ""{SURVEYDESCRIPTION}""  To participate, please click on the link below.  Sincerely,  {ADMINNAME} ({ADMINEMAIL})  ---------------------------------------------- Click here to do the survey: {SURVEYURL}  If you do not want to participate in this survey and don't want to receive any more invitations please click the following link: {OPTOUTURL}  If you are blacklisted but want to participate in this survey and want to receive invitations please click the following link: {OPTINURL}"		en																																																																																																																										
SL		surveyls_email_remind_subj		Reminder to participate in a survey		en																																																																																																																										
SL		surveyls_email_remind		"Dear {FIRSTNAME},  Recently we invited you to participate in a survey.  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.  The survey is titled: ""{SURVEYNAME}""  ""{SURVEYDESCRIPTION}""  To participate, please click on the link below.  Sincerely,  {ADMINNAME} ({ADMINEMAIL})  ---------------------------------------------- Click here to do the survey: {SURVEYURL}  If you do not want to participate in this survey and don't want to receive any more invitations please click the following link: {OPTOUTURL}"		en																																																																																																																										
SL		surveyls_email_register_subj		Survey registration confirmation		en																																																																																																																										
SL		surveyls_email_register		Dear {FIRSTNAME},  You, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.  To complete this survey, click on the following URL:  {SURVEYURL}  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}.		en																																																																																																																										
SL		surveyls_email_confirm_subj		Confirmation of your participation in our survey		en																																																																																																																										
SL		surveyls_email_confirm		Dear {FIRSTNAME},  this email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.  If you have any further questions about this email, please contact {ADMINNAME} on {ADMINEMAIL}.  Sincerely,  {ADMINNAME}		en																																																																																																																										
SL		surveyls_dateformat		5		en																																																																																																																										
SL		email_admin_notification_subj		Response submission for survey {SURVEYNAME}		en																																																																																																																										
SL		email_admin_notification		Hello,  A new response was submitted for your survey '{SURVEYNAME}'.  Click the following link to reload the survey: {RELOADURL}  Click the following link to see the individual response: {VIEWRESPONSEURL}  Click the following link to edit the individual response: {EDITRESPONSEURL}  View statistics by clicking here: {STATISTICSURL}		en																																																																																																																										
SL		email_admin_responses_subj		Response submission for survey {SURVEYNAME} with results		en																																																																																																																										
SL		email_admin_responses		Hello,  A new response was submitted for your survey '{SURVEYNAME}'.  Click the following link to reload the survey: {RELOADURL}  Click the following link to see the individual response: {VIEWRESPONSEURL}  Click the following link to edit the individual response: {EDITRESPONSEURL}  View statistics by clicking here: {STATISTICSURL}   The following answers were given by the participant: {ANSWERTABLE}		en																																																																																																																										
SL		surveyls_numberformat		1		en																																																																																																																										
G	G0	Group	1			en																																																																																																																										
Q	L	QQ	1	Single choice		en			N		1																1																																																																															1					1																	
A	0	A1		A1		en																																																																																																																										
A	0	A2		A2		en																																																																																																																										
Q	L	QQ	1	Single choice 2		en			N		1																1																																																																															1					1																	
A	0	A1		A1		en																																																																																																																										
A	0	A2		A2		en																																																																																																																										
limesurvey_survey_332646.txt (14,475 bytes)   
Bug heat2
Complete LimeSurvey version number (& build)150113
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionmysql 5
Server OS (if known)debian7/linux
Webserver software & version (if known)apache
PHP VersionPHP Version 5.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-01-13 17:33

developer   ~34276

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

Related Changesets

LimeSurvey: master 2c61f969

2016-01-13 16:33:18

DenisChenu

Details Diff
Fixed issue 10225: Import TSV can send broken CDbCommand
Dev: fix DefaultValue::model()->insertRecords
Dev: Don't try to insert empty DefaultValue in TSV
Dev: Test is error is an arry to show it (@todo : move it to warnig for TSV)
Dev: Allow use TSV for extension : more easy with LibreOffice
Affected Issues
10225
mod - application/controllers/admin/surveyadmin.php Diff File
mod - application/helpers/admin/import_helper.php Diff File
mod - application/models/Answer.php Diff File
mod - application/models/DefaultValue.php Diff File
mod - application/models/Question.php Diff File
mod - application/views/admin/survey/importSurvey_view.php Diff File

Issue History

Date Modified Username Field Change
2016-01-13 16:04 DenisChenu New Issue
2016-01-13 16:04 DenisChenu Status new => assigned
2016-01-13 16:04 DenisChenu Assigned To => DenisChenu
2016-01-13 16:04 DenisChenu File Added: limesurvey_survey_332646.txt
2016-01-13 17:33 DenisChenu Changeset attached => LimeSurvey master 2c61f969
2016-01-13 17:33 DenisChenu Note Added: 34276
2016-01-13 17:33 DenisChenu Resolution open => fixed
2016-01-13 17:41 DenisChenu Status assigned => resolved
2016-01-13 17:41 DenisChenu Fixed in Version => 2.06+
2016-01-22 08:54 c_schmitz Status resolved => closed