Bug 37833

Summary: Incorrect logic controlling display of OPAC language selection menus
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: david, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the display of the OPAC footer and menu options. Some combinations of OPACReportProblem, CookieConsent, OpacLangSelectorMode, and opaclanguagesdisplay system preferences were causing the OPAC footer and menu items not to display as expected (including the footer not displaying, or menu options not displaying).
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 35402    
Bug Blocks: 36337    
Attachments: Bug 37833: Incorrect logic controlling display of OPAC language selection menus
Bug 37833: Incorrect logic controlling display of OPAC language selection menus
Bug 37833: Incorrect logic controlling display of OPAC language selection menus
Cookie request - OPAC - covers up the footer so language not selectable
Cookie request - staff interface - language selectable
Bug 37833: Incorrect logic controlling display of OPAC language selection menus

Description Owen Leonard 2024-09-04 16:01:50 UTC
Bug 35402 introduced an error in the logic around how OPAC language menus are displayed. This could cause the footer language menu to not appear or for the whole footer menu to be absent.
Comment 1 Owen Leonard 2024-09-04 16:11:04 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2024-09-05 08:23:31 UTC
The patch needs a rebase, which I have fixed but found a problem.

See bug 36337 comment 6 (maybe the error I found there should actually be fixed here).
Comment 3 Owen Leonard 2024-09-05 12:00:47 UTC
Created attachment 171062 [details] [review]
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.
Comment 4 David Nind 2024-09-06 21:54:29 UTC
Created attachment 171154 [details] [review]
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 <david@davidnind.com>
Comment 5 David Nind 2024-09-06 21:55:19 UTC
Created attachment 171155 [details]
Cookie request - OPAC - covers up the footer so language not selectable
Comment 6 David Nind 2024-09-06 21:57:37 UTC
Created attachment 171156 [details]
Cookie request - staff interface - language selectable

The cookie request covers up the footer in the OPAC, so the language is not selectable.

In the staff interface it doesn't do this, and you can still select the language.

See the screenshots attached.

This was an issue before the patch, so maybe another bug?
Comment 7 Jonathan Druart 2024-09-12 07:28:33 UTC
Created attachment 171355 [details] [review]
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 <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Katrin Fischer 2024-09-13 10:08:10 UTC
Pushed for 24.11!

Well done everyone, thank you!