Bug 17896: load BakerTaylor module with use

We are incinsistent here, Amazon and Syndetics module are always loaeded in some places
BakerTaylor is conditional everywhere, and causes issues under plack

For simplicity sake I think we should just load this (small) module where it might be needed

To test:
1 - Disable Baker and Taylor images
2 - Restart plack
3 - Visit opac-readingrecord, opac-detail, opac-search, opac-shelves, opac-user
    Log in to opac
    Virew your reading history
    Make/view a list
    Search the catalog
    Look at an individual title
4 - Enable BakerTaylorEnabled
    If you don't have Baker and Taylor credentials, simply fudge them with bad data and enable
5 - Repeat steps above, in the word of Joubu "Kaboom"
6 - Apply patch
7 - Repeat 1-4
8 - You shoudl be able to load all the pages after enabling the pref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2020-02-21 12:56:53 +00:00 committed by Martin Renvoize
parent 325f82c8a9
commit 2dc33d4df2
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
5 changed files with 10 additions and 28 deletions

View File

@ -34,6 +34,8 @@ use C4::Circulation;
use C4::Tags qw(get_tags);
use C4::XISBN qw(get_xisbns);
use C4::External::Amazon;
use C4::External::BakerTaylor;
use C4::External::BakerTaylor qw(&image_url &link_url);
use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
use C4::Members;
use C4::XSLT;
@ -61,13 +63,6 @@ use Koha::Patrons;
use Koha::Ratings;
use Koha::Reviews;
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
require C4::External::BakerTaylor;
import C4::External::BakerTaylor qw(&image_url &link_url);
}
}
my $query = CGI->new();
my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0;

View File

@ -25,6 +25,8 @@ use C4::Koha;
use C4::Biblio;
use C4::Circulation;
use C4::Members;
use C4::External::BakerTaylor;
use C4::External::BakerTaylor qw(&image_url &link_url);
use Koha::DateUtils;
use MARC::Record;
@ -138,13 +140,6 @@ if (C4::Context->preference('BakerTaylorEnabled')) {
);
}
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
require C4::External::BakerTaylor;
import C4::External::BakerTaylor qw(&image_url &link_url);
}
}
for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above
C4::Context->preference($_) or next;
$template->param($_=>1);

View File

@ -51,6 +51,8 @@ use C4::Koha;
use C4::Tags qw(get_tags);
use C4::SocialData;
use C4::External::OverDrive;
use C4::External::BakerTaylor;
use C4::External::BakerTaylor qw(&image_url &link_url);
use Koha::CirculationRules;
use Koha::Libraries;
@ -90,13 +92,6 @@ if ( $branch_group_limit ) {
}
}
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
require C4::External::BakerTaylor;
import C4::External::BakerTaylor qw(&image_url &link_url);
}
}
my ($template,$borrowernumber,$cookie);
# decide which template to use
my $template_name;

View File

@ -22,6 +22,8 @@ use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use C4::Biblio;
use C4::External::BakerTaylor;
use C4::External::BakerTaylor qw(&image_url &link_url);
use C4::Koha;
use C4::Items;
use C4::Members;

View File

@ -24,6 +24,8 @@ use CGI qw ( -utf8 );
use C4::Auth;
use C4::Koha;
use C4::Circulation;
use C4::External::BakerTaylor;
use C4::External::BakerTaylor qw(&image_url &link_url);
use C4::Reserves;
use C4::Members;
use C4::Members::AttributeTypes;
@ -56,13 +58,6 @@ use Date::Calc qw(
my $query = new CGI;
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
require C4::External::BakerTaylor;
import C4::External::BakerTaylor qw(&image_url &link_url);
}
}
# CAS single logout handling
# Will print header and exit
C4::Context->preference('casAuthentication') and C4::Auth_with_cas::logout_if_required($query);