From b041f3c5852444058a6fa865532b92c7edb43668 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Sun, 25 Nov 2018 17:00:05 +0100 Subject: [PATCH] Fixed issue #14282: Language of Survey is set to default in token form --- application/helpers/frontend_helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/helpers/frontend_helper.php b/application/helpers/frontend_helper.php index fa019ea3ba2..25630e2e26d 100644 --- a/application/helpers/frontend_helper.php +++ b/application/helpers/frontend_helper.php @@ -1301,7 +1301,9 @@ function renderRenderWayForm($renderWay, array $scenarios, $sTemplateViewPath, $ Yii::app()->getController()->createAction('captcha'); } $oSurvey = Survey::model()->findByPk($surveyid); - + if(empty($aSurveyInfo)) { + $aSurveyInfo = getsurveyinfo($surveyid,App()->getLanguage()); + } // Rendering layout_user_forms.twig $thissurvey = $oSurvey->attributes; $thissurvey["aForm"] = $aForm; @@ -1318,7 +1320,6 @@ function renderRenderWayForm($renderWay, array $scenarios, $sTemplateViewPath, $ $aData['aSurveyInfo'] = $thissurvey; - $aSurveyInfo = getsurveyinfo($surveyid); $aData['aSurveyInfo'] = array_merge($aSurveyInfo, $aData['aSurveyInfo']); Yii::app()->twigRenderer->renderTemplateFromFile("layout_user_forms.twig", $aData, false);