Skip to content

Commit

Permalink
Dev: Store frontend flash message in state-key frontend{survey id}
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Apr 1, 2016
1 parent 0e795be commit 588129a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -5435,7 +5435,7 @@ private function _UpdateValuesInDatabase($updatedValues, $finished=false)
$message .= $this->gT('Error in SQL update'); // TODO - add SQL error?
}

LimeExpressionManager::addFrontendFlashMessage('error', $message);
LimeExpressionManager::addFrontendFlashMessage('error', $message, $this->sid);

}
// Save Timings if needed
Expand Down Expand Up @@ -10159,11 +10159,12 @@ public function loadTokenInformation($iSurveyId, $sToken = null, $bAnonymize = f
*
* @param string $type Yii type of flash: `error`, `notice`, 'success'
* @param string $message
* @param int $surveyid
* @return void
*/
public static function addFrontendFlashMessage($type, $message) {
public static function addFrontendFlashMessage($type, $message, $surveyid) {
$originalPrefix = Yii::app()->user->getStateKeyPrefix();
Yii::app()->user->setStateKeyPrefix('frontend' . $this->sid);
Yii::app()->user->setStateKeyPrefix('frontend' . $surveyid);
Yii::app()->user->setFlash('error', $message);
Yii::app()->user->setStateKeyPrefix($originalPrefix);
}
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Expand Up @@ -822,7 +822,7 @@ function submitfailed($errormsg = '', $query = null)
}
else
{
$email .= "$value: N/A (value not set in session)\n";
$email .= "$value: N/A\n";
}
}
$email .= "\n".gT("SQL CODE THAT FAILED","unescaped").":\n"
Expand Down

0 comments on commit 588129a

Please sign in to comment.