View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
04398Bug reportsSurvey takingpublic2010-06-16 22:30
Reporterjdalegonzalez Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.87+ 
Fixed in Version1.90RC2 
Summary04398: limesurvey/index.php at line 803 retests $column over and over when it doesn't need to.
Description

When reloading a survey, data is pulled from the table into the session. Most of the time, the column name is the same as the session variable and so the load is as simple as $_SESSION[$column] = $value. Sometimes, either the value from the table doesn't go in session, column name in session isn't the same or the column name isn't in the insertarray list. In those cases, there are special if blocks designed to do the right thing with the column and value. However, they're structured as independent if's when they all test column and so could be if (column == 'xxx') ELSEIF (column == 'YYY') ELSEIF (etc...)

Alternatively, most of the column tests could be collapsed into something like...

if ($column == "token")
{
$clienttoken=$value;
$token=$value;
}
elseif ($column == "saved_thisstep")
{
$_SESSION['step']=$value;
$thisstep=$value-1;
}
elseif ($column =='lastpage' && !isset($_SESSION['step']))
{
if ($value<1) $value=1;
$_SESSION['step']=$value;
$thisstep=$value-1;
}
elseif ($column == "scid" ||
$column == "srid" ||
$column == "datestamp" ||
$column == "startdate" ||
in_array($column, $_SESSION['insertarray'])) {
$_SESSION[$column]=$value;
}

OR just put scid, srid, datestamp and startdate into insertarray and remove the tests but I don't really understand the system enough to know what the side effects of putting something in insertarray are.

Steps To Reproduce

Look at line 803

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)8488
I will donate to the project if issue is resolved
Browserall
Database type & versionall
Server OS (if known)all
Webserver software & version (if known)all
PHP Versionall

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2010-06-16 22:30

administrator   ~12234

Thank you!

Issue History

Date Modified Username Field Change
2010-06-07 20:16 jdalegonzalez New Issue
2010-06-07 20:16 jdalegonzalez Status new => assigned
2010-06-07 20:16 jdalegonzalez Assigned To => user372
2010-06-10 11:27 c_schmitz Assigned To user372 => c_schmitz
2010-06-16 22:30 c_schmitz Note Added: 12234
2010-06-16 22:30 c_schmitz Status assigned => closed
2010-06-16 22:30 c_schmitz Resolution open => fixed
2010-06-16 22:30 c_schmitz Fixed in Version => 1.90RC2
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking