From d6ccbd86c4e894eb59959ee88b19b4c3c54b46a6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 4 Sep 2024 16:03:07 +0000 Subject: [PATCH] Bug 37833: Incorrect logic controlling display of OPAC language selection menus This patch corrects the logic around how the OPAC language menus are displayed. Because the footer and header lanugage menus have been combined into one, the logic for whether the menu should appear has to live outside the include. The patch also makes corrections to ensure that the footer menu appears even if the footer language menu is hidden. NOTE: This patch contains whitespace changes, so please view the diff accordingly. To test you should have at least one additional language installed. - Apply the patch and make sure the OPACLanguages system preference has more than one language checked. - Set opaclanguagesdisplay to "Allow." - In the OPAC, test that the various settings of the OpacLangSelectorMode preference work correctly (only top, only footer, both top and footer). - Test with OPACReportProblem on and off, and CookieConsent on and off. - Test with OPACReportProblem or CookieConsent enabled and opaclanguagesdisplay disabled. Signed-off-by: David Nind Signed-off-by: Jonathan Druart --- .../bootstrap/en/includes/langmenu.inc | 99 +++++++++---------- .../bootstrap/en/includes/masthead.inc | 3 +- .../bootstrap/en/includes/opac-bottom.inc | 77 +++++++-------- 3 files changed, 87 insertions(+), 92 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc index d4ed17a752f..10aa7146828 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc @@ -1,52 +1,49 @@ -[%# Following on one line for translatability %] -[% IF ( ( opaclanguagesdisplay ) && ( ! one_language_enabled ) && ( languages_loop ) && ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'top') ) %] -
- +
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 09051280df8..266309c1efe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -99,7 +99,8 @@ [% END # /IF OpacPublic %] [% IF Koha.Preference( 'opacuserlogin' ) == 1 || Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %] - [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %] + [%# Following on one line for translatability %] + [% IF ( ( opaclanguagesdisplay ) && ( ! one_language_enabled ) && ( languages_loop ) && ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'top') ) %] [% context = "header" %] [% INCLUDE 'langmenu.inc' %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index 6cc819a1a92..50d78ea97be 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -22,46 +22,43 @@ [% END #/ opaccredits %] - [% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'footer' %] - [% IF ( Koha.Preference('opaclanguagesdisplay') ) %] - [% IF ( languages_loop ) %] - [% UNLESS ( one_language_enabled ) %] -
-
- -
-
- [% END # / UNLESS ( one_language_enabled ) %] - [% END # / IF ( languages_loop && opaclanguagesdisplay ) %] - [% END # / IF opaclanguagesdisplay %] + [% IF ( Koha.Preference('OPACReportProblem') && Koha.Preference('KohaAdminEmailAddress') ) || Koha.Preference( 'CookieConsent' ) || OpacKohaUrl || ( ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'footer') ) %] +
+
+ +
+
[% END # /IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'footer' %] [% END # / UNLESS is_popup %] -- 2.34.1