Bug 33829: Fix add patron to patron list if PatronAutoComplete is off

When adding patrons to a patron list we get a JS error about undefined
variables. We can easily fix this problem by defining them even if the
pref is not set.

We are enabling the auto complete even if PatronAutoComplete if off.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 493819b92b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-05-25 15:07:25 +02:00 committed by Matt Blenkinsop
parent 39400e5061
commit cd4c50bb83
1 changed files with 5 additions and 3 deletions

View File

@ -69,12 +69,14 @@
</script>
[% END %]
[% IF ( PatronAutoComplete ) %]
<script>
// PatronAutoComplete
<script>
var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]";
var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
var singleBranchMode = '[% singleBranchMode | html %]';
</script>
[% IF ( PatronAutoComplete ) %]
<script>
// PatronAutoComplete
var loggedInClass = "";
$(document).ready(function(){
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]