Bugzilla – Attachment 18230 Details for
Bug 9452
C4::Letters does not function under Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 9452: C4::Letters not Plack-compatible
PASSED-QA-Bug-9452-C4Letters-not-Plack-compatible.patch (text/plain), 2.93 KB, created by
Katrin Fischer
on 2013-05-18 20:45:23 UTC
(
hide
)
Description:
[PASSED QA] Bug 9452: C4::Letters not Plack-compatible
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-05-18 20:45:23 UTC
Size:
2.93 KB
patch
obsolete
>From 32b30d9778be47120e26be50dc46e95f3692abe2 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sun, 12 May 2013 14:22:54 -0400 >Subject: [PATCH] [PASSED QA] Bug 9452: C4::Letters not Plack-compatible > >Prior to this patch, at more-or-less random intervals pages working >with notices will cease to function. To test: > >1) Apply patch. >2) Try to edit some notices. >3) Trigger some notices. >4) If you were able to edit the notices and trigger the notices, sign > off. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >All tests and QA script pass. >I did a regression script without Plack: >- edit, add, delete and copy notice >- trigger checkout/checkin notice >- print issueslip >No problems found. >--- > C4/Letters.pm | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index b8e2722..ff5b441 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -117,7 +117,12 @@ sub GetLetters { > return \%letters; > } > >-my %letter; >+# FIXME: using our here means that a Plack server will need to be >+# restarted fairly regularly when working with this routine. >+# A better option would be to use Koha::Cache and use a cache >+# that actually works in a persistent environment, but as a >+# short-term fix, our will work. >+our %letter; > sub getletter { > my ( $module, $code, $branchcode ) = @_; > >@@ -551,15 +556,17 @@ sub _substitute_tables { > } > } > >-my %handles = (); > sub _parseletter_sth { > my $table = shift; >+ my $sth; > unless ($table) { > carp "ERROR: _parseletter_sth() called without argument (table)"; > return; > } >- # check cache first >- (defined $handles{$table}) and return $handles{$table}; >+ # NOTE: we used to check whether we had a statement handle cached in >+ # a %handles module-level variable. This was a dumb move and >+ # broke things for the rest of us. prepare_cached is a better >+ # way to cache statement handles anyway. > my $query = > ($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : > ($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : >@@ -579,11 +586,11 @@ sub _parseletter_sth { > warn "ERROR: No _parseletter_sth query for table '$table'"; > return; # nothing to get > } >- unless ($handles{$table} = C4::Context->dbh->prepare($query)) { >+ unless ($sth = C4::Context->dbh->prepare_cached($query)) { > warn "ERROR: Failed to prepare query: '$query'"; > return; > } >- return $handles{$table}; # now cache is populated for that $table >+ return $sth; # now cache is populated for that $table > } > > =head2 _parseletter($letter, $table, $values) >@@ -597,7 +604,6 @@ sub _parseletter_sth { > > =cut > >-my %columns = (); > sub _parseletter { > my ( $letter, $table, $values ) = @_; > >-- >1.7.9.5
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 9452
:
18100
| 18230