From dbd8a8e4a3d32106b9fe8fb6a4fb60accb44b3a8 Mon Sep 17 00:00:00 2001 From: Gabriel Jenik Date: Tue, 22 Sep 2020 04:38:33 -0300 Subject: [PATCH] Fixed issue #16633: Error message when changing the data policy message language unless I check the box (#1574) * Fixed issue #16633: Error message when changing the data policy message language unless I check the box Making a form of its own for the language changer of the first page. This form as only have the language will not trigger server side validation of the policy. This is how it is in LS4 * Revert "Fixed issue #16633: Error message when changing the data policy message language unless I check the box" This reverts commit a48b2b5ff950d7ab2904575d8feacd072783b198. * Fixed issue #16633: Error message when changing the data policy message language unless I check the box Making a form of its own for the language changer of the first page. This form as only have the language will not trigger server side validation of the policy. This is how it is in LS4. Language changer from menu also updated. --- application/helpers/SurveyRuntimeHelper.php | 1 + .../views/subviews/content/firstpage.twig | 12 +++++------ .../views/subviews/messages/warnings.twig | 2 +- .../language_changer_first_page.twig | 20 ++++++++++++++++++- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 9da1b7b516b..7af5b168b68 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -931,6 +931,7 @@ private function setStep() private function displayFirstPageIfNeeded() { $bDisplayFirstPage = ($this->sSurveyMode != 'survey' && $_SESSION[$this->LEMsessid]['step'] == 0); + $this->aSurveyInfo['move'] = isset($this->sMove) ? $this->sMove : ''; if ($this->sSurveyMode == 'survey' || $bDisplayFirstPage) { diff --git a/themes/survey/vanilla/views/subviews/content/firstpage.twig b/themes/survey/vanilla/views/subviews/content/firstpage.twig index 1eeb6af38d2..c557f4da146 100644 --- a/themes/survey/vanilla/views/subviews/content/firstpage.twig +++ b/themes/survey/vanilla/views/subviews/content/firstpage.twig @@ -17,18 +17,18 @@ {# render the layout_global content block #} +{# Include the alert for no JavaScript #} +{{ include('./subviews/messages/no_js_alert.twig') }} + +{# Include the language changer selector #} +{{ include('./subviews/navigation/language_changer_first_page.twig') }} + {# Include the form opening tag #} {{ include('./subviews/header/start_form.twig') }} {# This will display the script and the hidden inputs needed for Expression Manager #} {{ aSurveyInfo.EM.ScriptsAndHiddenInputs }} - {# Include the alert for no JavaScript #} - {{ include('./subviews/messages/no_js_alert.twig') }} - - {# Include the language changer selector #} - {{ include('./subviews/navigation/language_changer.twig') }} - {# If survey mode is "All in One", this will add the welcome/privacy messages (if activated) #} {{ include('./subviews/messages/welcome.twig') }} diff --git a/themes/survey/vanilla/views/subviews/messages/warnings.twig b/themes/survey/vanilla/views/subviews/messages/warnings.twig index 3291fce7d97..5ed4925398b 100644 --- a/themes/survey/vanilla/views/subviews/messages/warnings.twig +++ b/themes/survey/vanilla/views/subviews/messages/warnings.twig @@ -35,7 +35,7 @@ {% endif %} {# Survey data policy not accepted warning #} -{% if aSurveyInfo.datasecuritynotaccepted == true %} +{% if aSurveyInfo.datasecuritynotaccepted == true and aSurveyInfo.move != 'changelang' %}
diff --git a/themes/survey/vanilla/views/subviews/navigation/language_changer_first_page.twig b/themes/survey/vanilla/views/subviews/navigation/language_changer_first_page.twig index d468110835b..d76bba64ac7 100644 --- a/themes/survey/vanilla/views/subviews/navigation/language_changer_first_page.twig +++ b/themes/survey/vanilla/views/subviews/navigation/language_changer_first_page.twig @@ -17,6 +17,24 @@ @see: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5 #} -{{ include('./subviews/navigation/language_changer.twig') }} +{% if aSurveyInfo.alanguageChanger.show == true %} + {% set htmlOptions = { + 'id' : 'firstpage-changelang', + 'autocomplete': 'off', + 'class' : 'form', + } %} + + + {{ C.Html.form( + ( aSurveyInfo.surveyUrl ), + 'post', + (htmlOptions) + ) }} + + + {{ include('./subviews/navigation/language_changer.twig') }} + + +{% endif %}