From c2f54d10e7e435509c4950b6896e828ee2ec29c4 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Fri, 27 Jan 2023 14:46:44 +0000 Subject: [PATCH] Bug 32721: (QA follow up) - fix QA issues This patches addresses issues raised by the QA tests. It also adds a missed import of the Branches file in the document head --- Koha/Template/Plugin/Branches.pm | 4 ++-- .../mysql/atomicupdate/bug_32721-add_branch_level_js.pl | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt | 4 ++-- .../opac-tmpl/bootstrap/en/includes/doc-head-close.inc | 1 + t/db_dependent/Template/Plugin/Branches.t | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index e439a500966..693c088fe24 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -157,7 +157,7 @@ sub GetBranchSpecificJS { my ($self, $branchcode) = @_; return q{} unless defined $branchcode; - + my $library = Koha::Libraries->find($branchcode); my $userjs = $library ? $library->userjs : q{}; @@ -168,7 +168,7 @@ sub GetBranchSpecificCSS { my ($self, $branchcode) = @_; return q{} unless defined $branchcode; - + my $library = Koha::Libraries->find($branchcode); my $usercss = $library ? $library->usercss : q{}; diff --git a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl index d59e45a4317..4471d96eef4 100644 --- a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl +++ b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl @@ -4,17 +4,17 @@ return { bug_number => "32721", description => "Allow branch specific javascript and css to be injected into the OPAC depending on a branchcode", up => sub { - my ($args) = @_; + my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - if( !column_exists( 'branches', 'userjs' ) ) { + if( !column_exists( 'branches', 'userjs' ) ) { $dbh->do(q{ ALTER TABLE branches ADD COLUMN `userjs` longtext DEFAULT NULL AFTER `public` }); say $out "Added column 'branches.userjs'"; } - if( !column_exists( 'branches', 'usercss' ) ) { + if( !column_exists( 'branches', 'usercss' ) ) { $dbh->do(q{ ALTER TABLE branches ADD COLUMN `usercss` longtext DEFAULT NULL AFTER `userjs` }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 33880c39330..b7454331fbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -294,7 +294,7 @@ Libraries › Administration › Koha
Click to edit - +
@@ -302,7 +302,7 @@ Libraries › Administration › Koha
Click to edit - +
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc index a1b7ba5eda1..476e83afa96 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc @@ -1,5 +1,6 @@ [% USE raw %] [% USE Koha %] +[% USE Branches %] [%- USE KohaPlugins -%] [% USE Asset %] diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t index fe23f008750..47722038ad2 100755 --- a/t/db_dependent/Template/Plugin/Branches.t +++ b/t/db_dependent/Template/Plugin/Branches.t @@ -218,7 +218,7 @@ subtest 'pickup_locations() tests' => sub { $schema->storage->txn_rollback; }; -subtest 'branch specfic js and css' => sub { +subtest 'branch specific js and css' => sub { plan tests => 2; -- 2.37.1 (Apple Git-137.1)