From 55850d03a7c5795705faecc8af31ecf04bdd1c40 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 25 Mar 2025 16:43:11 +0000 Subject: [PATCH] Bug 35604: Multiple QA followups Multiple fixes: - File permmissions - Capitalization - Translatability - Use of console.log - Atomic update description typo fix --- installer/data/mysql/atomicupdate/bug_35604.pl | 4 ++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js | 10 +++------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js | 10 +++------- t/db_dependent/Koha/ILL/Backends.t | 0 t/db_dependent/Koha/ILL/Request/Workflow/ConfirmAuto.t | 0 7 files changed, 11 insertions(+), 19 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_35604.pl mode change 100644 => 100755 t/db_dependent/Koha/ILL/Backends.t mode change 100644 => 100755 t/db_dependent/Koha/ILL/Request/Workflow/ConfirmAuto.t diff --git a/installer/data/mysql/atomicupdate/bug_35604.pl b/installer/data/mysql/atomicupdate/bug_35604.pl old mode 100644 new mode 100755 index cd347bcac85..2979ea49514 --- a/installer/data/mysql/atomicupdate/bug_35604.pl +++ b/installer/data/mysql/atomicupdate/bug_35604.pl @@ -3,13 +3,13 @@ use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35604", - description => "Add new AutoILLBackendPriority system preferences", + description => "Add new AutoILLBackendPriority system preference", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; $dbh->do( - q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'); } + q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'); } ); say_success( $out, "Added new system preference 'AutoILLBackendPriority'" ); }, diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index b64d88a6d09..7f35027dc54 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -93,7 +93,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), ('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'), ('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'), -('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'), +('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'), ('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','YesNo'), ('AutomaticCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','YesNo'), ('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js index 04461b15806..a66bf03b77e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js @@ -34,7 +34,7 @@ $(document).ready(function () { __("Verification timed out.") ); } else { - let message = "Error"; + let message = __("Error"); if (request.hasOwnProperty("responseJSON")) { if (request.responseJSON.error) { message = request.responseJSON.error; @@ -61,12 +61,8 @@ $(document).ready(function () { function getBackendsAvailability(auto_backends, metadata) { let promises = []; for (const auto_backend of auto_backends) { - try { - const prom = getBackendAvailability(auto_backend, metadata); - promises.push(prom); - } catch (e) { - console.log(e); - } + const prom = getBackendAvailability(auto_backend, metadata); + promises.push(prom); } Promise.allSettled(promises).then(() => { let auto_backend = auto_backends.find(backend => backend.available); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index da505b965e6..be7e0af8898 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -445,9 +445,9 @@ [% END %] [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %] [% IF Koha.Preference( 'AutoILLBackendPriority' ) %] -
  • Make an automatic Interlibrary loan request
  • +
  • Make an interlibrary loan request
  • [% ELSE %] -
  • Make an Interlibrary loan request
  • +
  • Make an interlibrary loan request
  • [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js b/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js index cc258854731..7c59e3d185e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js @@ -34,7 +34,7 @@ $(document).ready(function () { __("Verification timed out.") ); } else { - let message = "Error"; + let message = __("Error"); if (request.hasOwnProperty("responseJSON")) { if (request.responseJSON.error) { message = request.responseJSON.error; @@ -61,12 +61,8 @@ $(document).ready(function () { function getBackendsAvailability(auto_backends, metadata) { let promises = []; for (const auto_backend of auto_backends) { - try { - const prom = getBackendAvailability(auto_backend, metadata); - promises.push(prom); - } catch (e) { - console.log(e); - } + const prom = getBackendAvailability(auto_backend, metadata); + promises.push(prom); } Promise.allSettled(promises).then(() => { let auto_backend = auto_backends.find(backend => backend.available); diff --git a/t/db_dependent/Koha/ILL/Backends.t b/t/db_dependent/Koha/ILL/Backends.t old mode 100644 new mode 100755 diff --git a/t/db_dependent/Koha/ILL/Request/Workflow/ConfirmAuto.t b/t/db_dependent/Koha/ILL/Request/Workflow/ConfirmAuto.t old mode 100644 new mode 100755 -- 2.39.5