Bug 30958: OPAC overdrive search result page broken for translations
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Mon, 13 Jun 2022 22:54:54 +0000 (22:54 +0000)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Sat, 13 Aug 2022 15:52:52 +0000 (17:52 +0200)
commit14df91408da10906288d337bfcc5c96880f2e825
tree04acd202146806ea21f8b9c17b7fa7ffec06bfd6
parent60c857d44b52e19ae703e89c0c92d4aa9fbe27c4
Bug 30958: OPAC overdrive search result page broken for translations

Note: You will need a valid OverDrive subscription to test this.

This patch fixes a JavaScript error thrown on the OPAC overdrive search
results page for libraries using translation templates and who don't
have the OverDrivePasswordRequired system preference = 'Required'.

Test plan:
1. Install the en-NZ translation: https://wiki.koha-community.org/wiki/Installation_of_additional_languages_for_OPAC_and_INTRANET_staff_client

2. Enable the en-NZ language:
   - In the OPACLanguages system preference -> tick 'English New Zealand
     (en-NZ)' checkbox and untick 'English (en)'

3. Fill in the OverDrive system preferences:
   - Make sure you set: OverDrivePasswordRequired = "Not required"

4. Perform an OPAC search

5. Click on the Overdrive results link

6. Open the browser console and notice there is a JS error, and the
   OverDrive results do not load

7. Apply patch

8. Update the en_NZ translation:

9. Repeat steps 4, 5 and 6 and notice there is no JavaScript error and
   the OverDrive results do display

Sponsored-by: Melbourne Athenaeum Library, Australia
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ade61b5e0c185fd7263ab6f101b1a4082d0ea0dd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f5c43cf2636e3e59d58b6ea739491dea192a51d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6fb34f0d66d6b0882225c5edf099cdf79cdcc617)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt