Skip to content

Commit

Permalink
Fixed issue: Return from Quota resets survey completely.
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jul 30, 2018
1 parent 6188c52 commit f539e5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -752,7 +752,11 @@ private function checkQuotas()
/* quota submitted */
if ($this->sMove == 'confirmquota') {
checkCompletedQuota($this->iSurveyid);
}
}
/* quota submitted */
if ($this->sMove == 'returnfromquota') {
LimeExpressionManager::JumpTo($this->param->thisstep);
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions application/helpers/frontend_helper.php
Expand Up @@ -1884,8 +1884,8 @@ function checkCompletedQuota($surveyid, $return = false)
$thissurvey['aQuotas'] = array();
$thissurvey['aQuotas']['sMessage'] = $sMessage;
$thissurvey['aQuotas']['bShowNavigator'] = !$closeSurvey;
$thissurvey['aQuotas']['sQuotaStep'] = isset($_SESSION['survey_'.$surveyid]['step']) ? $_SESSION['survey_'.$surveyid]['step'] : 0; // Surely not needed
$thissurvey['aQuotas']['sClientToken'] = $sClientToken;
$thissurvey['aQuotas']['sQuotaStep'] = 'returnfromquota';
$thissurvey['aQuotas']['aPostedQuotaFields'] = isset($aPostedQuotaFields) ? $aPostedQuotaFields : '';
$thissurvey['aQuotas']['sPluginBlocks'] = implode("\n", $blocks);
$thissurvey['aQuotas']['sUrlDescription'] = $sUrlDescription;
Expand All @@ -1894,8 +1894,8 @@ function checkCompletedQuota($surveyid, $return = false)


$thissurvey['aQuotas']['hiddeninputs'] = '<input type="hidden" name="sid" value="'.$surveyid.'" />
<input type="hidden" name="token" value="'.$thissurvey['aQuotas']['sClientToken'].'" />
<input type="hidden" name="thisstep" value="'.$thissurvey['aQuotas']['sQuotaStep'].'" />';
<input type="hidden" name="token" value="'.$thissurvey['aQuotas']['sClientToken'].'" />
<input type="hidden" name="thisstep" value="'.(isset($_SESSION['survey_'.$surveyid]['step']) ? $_SESSION['survey_'.$surveyid]['step'] : 0).'" />';

This comment has been minimized.

Copy link
@LouisGac

LouisGac Jul 30, 2018

Contributor

doesn't work in question by question mode. I guess "0" should be replaced by something else.

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Jul 30, 2018

Collaborator

Strange, i don't see why $SESSION['survey'.$surveyid]['step'] can be not set in quota end. We don't delete session at a time ?


if (!empty($thissurvey['aQuotas']['aPostedQuotaFields'])){
Expand Down
2 changes: 1 addition & 1 deletion themes/survey/vanilla/views/subviews/content/quotas.twig
Expand Up @@ -89,7 +89,7 @@
</div>
</div>

{{ aSurveyInfo.hiddeninputs }}
{{ aSurveyInfo.aQuotas.hiddeninputs }}

</form>
{% endif %}
Expand Down

0 comments on commit f539e5c

Please sign in to comment.