View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05367Bug reportsImport/Exportpublic2011-08-11 18:19
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91+ 
Fixed in Version1.91+ 
Summary05367: Unable to import old survey with Array dual scale question
Description

If you have a array dual scale question,
activate the survey,
have some answer,
deactivate survey
reactivate survey
try to reimport old answer.

You have a SQL error with some 62737X76X1124ACC#0 inside (with mysql)

Unknown column 'id' in 'field list':SELECT id, submitdate, lastpage, startlanguage, token, 62737X76X1124SPD#0, 62737X76X1124SPD#1, 62737X76X1124DSN#0, 62737X76X1124DSN#1, 62737X76X1124ACC#0, 62737X76X1124ACC#1 FROM lime_old_survey_62737_20110729015006

Steps To Reproduce

Import the survey or do a survey with on array dual scale question
Activate, answer, deactivate , trye to reimport

Additional Information

For the select, we can use :
-- $queryOldValues = "SELECT ".implode(", ",$aValidFields)." FROM {$oldtable} ";
++ $queryOldValues = "SELECT ".implode(", ",array_map("db_quote_id",$aValidFields))." FROM {$oldtable} ";

But after we use GetInsertSQL, and have the error:
INSERT INTO lime_survey_62737 ( SUBMITDATE, LASTPAGE, STARTLANGUAGE, TOKEN, 62737X76X1124SPD#0, 62737X76X1124SPD#1, 62737X76X1124DSN#0, 62737X76X1124DSN#1, 62737X76X1124ACC#0, 62737X76X1124ACC#1 ) VALUES ( '2011-07-29 01:49:58', 2, 'en', null, '5', '1', '3', '1', '5', '1' )
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 '' at line 1

( AdoDB error ????? )

I trye with a little quick and dirty fix:
foreach ($row as $key => $value) {
$quoterow[db_quote_id($key)]=$value;
}
But after we can't use GetInsertSQL:
Error:

Query was empty

I thgink we can fix it quick and dirty with an INSERT ... "manual" request ( can do it ))without adodb but maybe there are another possibility and we loose adodb speed ?

Thanks

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)10563
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionMysql 5.1.49
Server OS (if known)debian/linux
Webserver software & version (if known)apache
PHP Version5.3

Relationships

related to 05392 closedDenisChenu ERROR: column "SID" of relation "lime_surveys" does not exist 

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-07-29 16:09

administrator   ~15888

How do you try to reimport the 'old answer' exactly?

DenisChenu

DenisChenu

2011-07-29 18:46

developer   ~15893

Sorry :)

From admin/admin.php?action=importoldresponses&sid=62737

On the statistics page

With
$databasetype = 'mysql';
or
$databasetype = 'mysqli';

c_schmitz

c_schmitz

2011-07-30 00:00

administrator   ~15900

Last edited: 2011-07-30 00:00

Try setting the global
$ADODB_QUOTE_FIELDNAMES to true. that will make GetInsertSQL properly quote the fieldnames.
Please commit the fix then.

DenisChenu

DenisChenu

2011-08-01 16:09

developer   ~15918

Fixed in 10618, thank you

Issue History

Date Modified Username Field Change
2011-07-29 02:25 DenisChenu New Issue
2011-07-29 02:27 DenisChenu File Added: limesurvey_survey_62737.lss
2011-07-29 16:08 c_schmitz Assigned To => c_schmitz
2011-07-29 16:08 c_schmitz Status new => assigned
2011-07-29 16:09 c_schmitz Note Added: 15888
2011-07-29 18:46 DenisChenu Note Added: 15893
2011-07-30 00:00 c_schmitz Note Added: 15900
2011-07-30 00:00 c_schmitz Assigned To c_schmitz => DenisChenu
2011-07-30 00:00 c_schmitz Note Edited: 15900
2011-08-01 16:09 DenisChenu Note Added: 15918
2011-08-01 16:09 DenisChenu Status assigned => closed
2011-08-01 16:09 DenisChenu Resolution open => fixed
2011-08-01 16:09 DenisChenu Fixed in Version => 1.91+
2011-08-11 18:19 c_schmitz Relationship added related to 05392