View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
09466Bug reportsImport/Exportpublic2015-05-20 11:11
Reporterdavid2013 Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09466: "Import response from deactivated table" doesn't import timing table
Description

When we use function "Import response from deactivated table", it doesn't import the timing table even though the timing table exist.

Steps To Reproduce
  1. Create any survey
  2. activated with timing table
  3. Take a survey so that we have some data.
  4. Deactivated and then re-activated again
  5. Import response from deactivated table, check option "import timing if exist"
  6. timing table doesn't imported even though it exist.
TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)demo version
I will donate to the project if issue is resolvedNo
Browserdemo version
Database type & versiondemo version
Server OS (if known)demo version
Webserver software & version (if known)demo version
PHP Versiondemo version

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2015-01-29 14:38

administrator   ~31545

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

c_schmitz

c_schmitz

2015-01-29 14:39

administrator   ~31546

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

david2013

david2013

2015-01-30 06:12

reporter   ~31561

I see you change one line from
$sNewTimingsTable = "{{{$surveyid}timings}}";
to
$sNewTimingsTable = "survey
{$surveyid}_timings";

This doesn't solve the problem. Still a few problems. First. the program doesn't go into the if statement below; Second, even go into the statement, the variable "$schema" seems not defined as it throw error. Third, what does "$aSRIDConversions" array do? It's empty array, but program is checking if id is defined in this array. then line "$sTable['id']=$aSRIDConversions[$sTable['id']];" will never executed.

======================================================================================================================

            if (isset($_POST['timings']) && $_POST['timings'] == 1 && tableExists($sOldTimingsTable) && tableExists($sNewTimingsTable))
            {
            echo "come here";
                // Import timings
                $aFieldsOldTimingTable=array_values($schema->getTable($sOldTimingsTable)->columnNames);
                $aFieldsNewTimingTable=array_values($schema->getTable($sNewTimingsTable)->columnNames);

                $aValidTimingFields=array_intersect($aFieldsOldTimingTable,$aFieldsNewTimingTable);

                $queryOldValues = "SELECT ".implode(", ",$aValidTimingFields)." FROM {$sOldTimingsTable} ";
                $resultOldValues = dbExecuteAssoc($queryOldValues) or show_error(&quot;Error:<br />$queryOldValues<br />&quot;);
                $iRecordCountT=0;
                $aSRIDConversions=array();
                foreach ($resultOldValues->readAll() as $sTable)
                {
                    if (isset($aSRIDConversions[$sTable['id']]))
                    {
                        $sTable['id']=$aSRIDConversions[$sTable['id']];
                    }
                    else continue;
                    //$sInsertSQL=Yii::app()->db->GetInsertSQL($sNewTimingsTable,$row);
                    $sInsertSQL=&quot;INSERT into {$sNewTimingsTable} (&quot;.implode(&quot;,&quot;, array_map(&quot;dbQuoteID&quot;, array_keys($sTable))).&quot;) VALUES (&quot;.implode(&quot;,&quot;, array_map(&quot;dbQuoteAll&quot;, array_values($sTable))).&quot;)&quot;;
                    $aTables = dbExecuteAssoc($sInsertSQL) or show_error(&quot;Error:<br />$sInsertSQL<br />&quot;);
                    $iRecordCountT++;
                }
                Yii::app()->session['flashmessage'] = sprintf(gT(&quot;%s old response(s) and according timings were successfully imported.&quot;),$imported,$iRecordCountT);
            }
david2013

david2013

2015-02-21 15:26

reporter   ~31715

I try on latest demo version. Still can not import timing

c_schmitz

c_schmitz

2015-05-08 11:43

administrator   ~32135

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

c_schmitz

c_schmitz

2015-05-08 11:43

administrator   ~32136

Fix committed to 2.06 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=15141

c_schmitz

c_schmitz

2015-05-20 11:11

administrator   ~32250

Version 2.05+ Build 150520 released.

Related Changesets

LimeSurvey: master 6264c28f

2015-01-29 13:38:21

c_schmitz

Details Diff
Fixed issue 09466: "Import response from deactivated table" doesn't import timing table Affected Issues
09466
mod - application/controllers/admin/dataentry.php Diff File

LimeSurvey: 2.06 f1d76aee

2015-01-29 13:39:30

c_schmitz

Details Diff
Fixed issue 09466: "Import response from deactivated table" doesn't import timing table Affected Issues
09466
mod - application/controllers/admin/dataentry.php Diff File

LimeSurvey: master e9ad71fe

2015-05-08 09:42:48

c_schmitz

Details Diff
Fixed issue 09466: "Import response from deactivated table" doesn't import timing table Affected Issues
09466
mod - application/controllers/admin/dataentry.php Diff File

LimeSurvey: 2.06 a2c3fe32

2015-05-08 09:42:48

c_schmitz

Details Diff
Fixed issue 09466: "Import response from deactivated table" doesn't import timing table Affected Issues
09466
mod - application/controllers/admin/dataentry.php Diff File

Issue History

Date Modified Username Field Change
2015-01-20 04:51 david2013 New Issue
2015-01-29 14:35 c_schmitz Assigned To => c_schmitz
2015-01-29 14:35 c_schmitz Status new => assigned
2015-01-29 14:38 c_schmitz Changeset attached => LimeSurvey master 6264c28f
2015-01-29 14:38 c_schmitz Note Added: 31545
2015-01-29 14:38 c_schmitz Resolution open => fixed
2015-01-29 14:39 c_schmitz Changeset attached => LimeSurvey 2.06 f1d76aee
2015-01-29 14:39 c_schmitz Note Added: 31546
2015-01-29 14:40 c_schmitz Status assigned => resolved
2015-01-29 14:40 c_schmitz Fixed in Version => 2.05+
2015-01-30 06:12 david2013 Note Added: 31561
2015-01-30 06:12 david2013 Status resolved => feedback
2015-01-30 06:12 david2013 Resolution fixed => reopened
2015-02-21 15:26 david2013 Note Added: 31715
2015-02-21 15:26 david2013 Status feedback => assigned
2015-05-08 11:43 c_schmitz Changeset attached => LimeSurvey master e9ad71fe
2015-05-08 11:43 c_schmitz Note Added: 32135
2015-05-08 11:43 c_schmitz Changeset attached => LimeSurvey 2.06 a2c3fe32
2015-05-08 11:43 c_schmitz Note Added: 32136
2015-05-08 11:43 c_schmitz Status assigned => resolved
2015-05-08 11:43 c_schmitz Resolution reopened => fixed
2015-05-20 11:11 c_schmitz Note Added: 32250
2015-05-20 11:11 c_schmitz Status resolved => closed