Skip to content

Commit

Permalink
Fixed issue #10162: new visit on a survey with token deletes last entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed Oct 22, 2018
1 parent 77b7fc2 commit 2461a56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/helpers/frontend_helper.php
Expand Up @@ -2047,6 +2047,11 @@ function killSurveySession($iSurveyID)
unset($_SESSION['survey_'.$iSurveyID]);
// Force EM to refresh
LimeExpressionManager::SetDirtyFlag();

// unsetting LEMsingleton from session so new survey execution would start with new LEM instance
// SetDirtyFlag() method doesn't reset LEM properly
// this solution fixes bug: https://bugs.limesurvey.org/view.php?id=10162
unset($_SESSION["LEMsingleton"]);
}

/**
Expand Down

3 comments on commit 2461a56

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strange ?

LimeExpressionManager::SetDirtyFlag set $_SESSION['LEMdirtyFlag'] and if $_SESSION['LEMdirtyFlag'] singleton is reloaded, maybe we need to kill LEMsingleton before create it again ?

There are surely somewhere where LEMsingleton is taken from session, not from LimeExpressionManager ?

@dominikvitt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

LEMsingleton is used only in LimeExpressionManager, it has a minimal impact.
LEMsingleton is taken from session only in LEM's singleton function.

@Shnoulle
Copy link
Collaborator

@Shnoulle Shnoulle commented on 2461a56 Oct 23, 2018

Choose a reason for hiding this comment

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

Yes, OK, with this but, maybe it's better to reset $_SESSION['LEMsingleton'] direcftly in ExpressionManager : here

or here :
public static function SetDirtyFlag()

Because your fix mean there are somewhere we get instance from session on not from LimeExpressionManager :)

Please sign in to comment.