Skip to content

Commit

Permalink
Fixed issue #16633: Error message when changing the data policy messa…
Browse files Browse the repository at this point in the history
…ge 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 a48b2b5.

* 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.
  • Loading branch information
gabrieljenik committed Sep 22, 2020
1 parent 3c29246 commit dbd8a8e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -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) {

Expand Down
12 changes: 6 additions & 6 deletions themes/survey/vanilla/views/subviews/content/firstpage.twig
Expand Up @@ -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') }} <!-- main form -->

{# 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') }}

Expand Down
Expand Up @@ -35,7 +35,7 @@
{% endif %}

{# Survey data policy not accepted warning #}
{% if aSurveyInfo.datasecuritynotaccepted == true %}
{% if aSurveyInfo.datasecuritynotaccepted == true and aSurveyInfo.move != 'changelang' %}
<!-- Preview mode warning -->
<div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible fade in alert-dismissible" {{ aSurveyInfo.attr.activealert }} >
<button {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} close" ><span aria-hidden="true">×</span></button>
Expand Down
Expand Up @@ -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',
} %}

<!-- Start of language change Form-->
{{ C.Html.form(
( aSurveyInfo.surveyUrl ),
'post',
(htmlOptions)
) }}


{{ include('./subviews/navigation/language_changer.twig') }}

</form>
{% endif %}


0 comments on commit dbd8a8e

Please sign in to comment.