Skip to content

Commit

Permalink
Fixed issue #10162: Jump instead of navigate to avoid saving NULL-val…
Browse files Browse the repository at this point in the history
…ues for old question group cookie left-over (reverted from commit 2460c69)
  • Loading branch information
c-schmitz committed Jan 22, 2016
1 parent b47e3af commit 4fb2c85
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
2 changes: 0 additions & 2 deletions application/controllers/survey/index.php
Expand Up @@ -553,7 +553,6 @@ function action()
}
}
}

// Preview action : Preview right already tested before
if ($previewmode)
{
Expand Down Expand Up @@ -584,7 +583,6 @@ function action()
{
echo "<script type='text/javascript'> $(document).ready( function() { alert('".gT("Your responses were successfully saved.","js")."');}) </script>";
}

}

function _getParameters($args = array(), $post = array())
Expand Down
11 changes: 1 addition & 10 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -223,7 +223,6 @@ function run($surveyid,$args) {
'token' => (isset($clienttoken) ? $clienttoken : NULL),
);


//Security Checked: POST, GET, SESSION, REQUEST, returnGlobal, DB
$previewgrp = false;
if ($surveyMode == 'group' && isset($param['action']) && ($param['action'] == 'previewgroup'))
Expand Down Expand Up @@ -253,9 +252,7 @@ function run($surveyid,$args) {
$sTemplatePath = $_SESSION[$LEMsessid]['templatepath'];

if($surveyid != LimeExpressionManager::getLEMsurveyId())
{
LimeExpressionManager::SetDirtyFlag();
}

LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions, false, $LEMdebugLevel);
$_SESSION[$LEMsessid]['step'] = 0;
Expand All @@ -265,13 +262,7 @@ function run($surveyid,$args) {
}
elseif (isset($thissurvey['showwelcome']) && $thissurvey['showwelcome'] == 'N')
{
// BUG: This will CLEAR and SAVE IN DB the last question group to NULL if it's still in the cookie (which it is if same browser is used).
//$moveResult = LimeExpressionManager::NavigateForwards();

// Jump WITHOUT saving anything (needed for e-mail link).
LimeExpressionManager::JumpTo(1, false, false, true);

// TODO: Delete this line?
$moveResult = LimeExpressionManager::NavigateForwards();
//$_SESSION[$LEMsessid]['step']=1;
}
}
Expand Down
4 changes: 0 additions & 4 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -153,10 +153,8 @@ class LimeExpressionManager {
* @var type
*/
private $allOnOnePage=false;

/**
* survey mode. One of 'survey', 'group', or 'question'
* @todo Please add more information here. What does the alternatives mean?
* @var string
*/
private $surveyMode='group';
Expand Down Expand Up @@ -4841,7 +4839,6 @@ static function StartSurvey($surveyid,$surveyMode='group',$aSurveyOptions=NULL,$
$LEM->indexQseq=array();
$LEM->qrootVarName2arrayFilter=array();
templatereplace("{}"); // Needed for coreReplacements in relevance equation (in all mode)

if (isset($_SESSION[$LEM->sessid]['startingValues']) && is_array($_SESSION[$LEM->sessid]['startingValues']) && count($_SESSION[$LEM->sessid]['startingValues']) > 0)
{
$startingValues = array();
Expand Down Expand Up @@ -5511,7 +5508,6 @@ static function JumpTo($seq,$preview=false,$processPOST=true,$force=false,$chang

$LEM->ParseResultCache=array(); // to avoid running same test more than once for a given group
$LEM->updatedValues = array();
// TODO: Should seq be below 0? It will be -1 after survey submit and re-click on invitation link in e-mail (see issue #10162).
--$seq; // convert to 0-based numbering

switch ($LEM->surveyMode)
Expand Down
1 change: 1 addition & 0 deletions application/helpers/frontend_helper.php
Expand Up @@ -18,6 +18,7 @@ function loadanswers()
global $thissurvey, $thisstep;
global $clienttoken;


$scid=Yii::app()->request->getQuery('scid');
if (Yii::app()->request->getParam('loadall') == "reload")
{
Expand Down

0 comments on commit 4fb2c85

Please sign in to comment.