Skip to content

Commit

Permalink
Fixed issue: response created at welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed May 23, 2018
1 parent 096b75d commit 9ef2467
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/helpers/expressions/em_manager_helper.php
Expand Up @@ -5001,7 +5001,9 @@ public static function StartSurvey($surveyid,$surveyMode='group',$aSurveyOptions
$LEM->indexGseq=array();
$LEM->indexQseq=array();
$LEM->qrootVarName2arrayFilter=array();
if (isset($_SESSION[$LEM->sessid]['startingValues']) && is_array($_SESSION[$LEM->sessid]['startingValues']) && count($_SESSION[$LEM->sessid]['startingValues']) > 0)

// NOTE: now that we use a seed, count($_SESSION[$LEM->sessid]['startingValues']) start at 1
if (isset($_SESSION[$LEM->sessid]['startingValues']) && is_array($_SESSION[$LEM->sessid]['startingValues']) && count($_SESSION[$LEM->sessid]['startingValues']) > 1)
{
foreach ($_SESSION[$LEM->sessid]['startingValues'] as $k=>$value)
{
Expand Down

3 comments on commit 9ef2467

@c-schmitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olleharstedt Can you crosscheck this fix? Not really sure if it is correct.

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is.
Olle added a seed info in the array $_SESSION[$LEM->sessid]['startingValues'], so its minimum size is now 1, not 0.

@olleharstedt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this was my bug. I'd like to create a unit-test for it none the less.

Please sign in to comment.