Bugzilla – Attachment 75190 Details for
Bug 16342
Plack breaks Baker and Taylor cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16342: Fix variable scope to make BakerTaylor works under plack
Bug-16342-Fix-variable-scope-to-make-BakerTaylor-w.patch (text/plain), 2.58 KB, created by
Jonathan Druart
on 2018-05-08 20:19:17 UTC
(
hide
)
Description:
Bug 16342: Fix variable scope to make BakerTaylor works under plack
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-05-08 20:19:17 UTC
Size:
2.58 KB
patch
obsolete
>From 2ce773807e0ead23e80401b74ab13b2379bc9e87 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 8 May 2018 17:18:58 -0300 >Subject: [PATCH] Bug 16342: Fix variable scope to make BakerTaylor works under > plack > >--- > C4/External/BakerTaylor.pm | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm >index 99d4dd5b70..7659bb8542 100644 >--- a/C4/External/BakerTaylor.pm >+++ b/C4/External/BakerTaylor.pm >@@ -37,20 +37,20 @@ BEGIN { > %EXPORT_TAGS = (all=>\@EXPORT_OK); > } > >-# These variables are plack safe: they are initialized each time >-my ( $user, $pass, $agent, $image_url, $link_url ); > > sub _initialize { >+ my ( $user, $pass, $agent, $image_url, $link_url ); > $user = (@_ ? shift : C4::Context->preference('BakerTaylorUsername') ) || ''; # LL17984 > $pass = (@_ ? shift : C4::Context->preference('BakerTaylorPassword') ) || ''; # CC82349 > $link_url = (@_ ? shift : C4::Context->preference('BakerTaylorBookstoreURL')); > $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value="; > $agent = "Koha/$VERSION [en] (Linux)"; > #"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this >+ return ( $user, $pass, $agent, $image_url, $link_url ); > } > > sub image_url { >- _initialize(); >+ my ( $user, $pass, $agent, $image_url, $link_url ) = _initialize(); > ($user and $pass) or return; > my $isbn = (@_ ? shift : ''); > $isbn =~ s/(p|-)//g; # sanitize >@@ -58,7 +58,7 @@ sub image_url { > } > > sub link_url { >- _initialize(); >+ my ( $user, $pass, $agent, $image_url, $link_url ) = _initialize(); > my $isbn = (@_ ? shift : ''); > $isbn =~ s/(p|-)//g; # sanitize > $link_url or return; >@@ -66,7 +66,7 @@ sub link_url { > } > > sub content_cafe_url { >- _initialize(); >+ my ( $user, $pass, $agent, $image_url, $link_url ) = _initialize(); > ($user and $pass) or return; > my $isbn = (@_ ? shift : ''); > $isbn =~ s/(p|-)//g; # sanitize >@@ -74,7 +74,7 @@ sub content_cafe_url { > } > > sub http_jacket_link { >- _initialize(); >+ my ( $user, $pass, $agent, $image_url, $link_url ) = _initialize(); > my $isbn = shift or return; > $isbn =~ s/(p|-)//g; # sanitize > my $image = availability($isbn); >@@ -86,7 +86,7 @@ sub http_jacket_link { > } > > sub availability { >- _initialize(); >+ my ( $user, $pass, $agent, $image_url, $link_url ) = _initialize(); > my $isbn = shift or return; > ($user and $pass) or return; > $isbn =~ s/(p|-)//g; # sanitize >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16342
: 75190