Bugzilla – Attachment 12843 Details for
Bug 8890
Packages can't be built on master, db dependent test
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8890: C4/HoldsQueue requires DB
Bug-8890-C4HoldsQueue-requires-DB.patch (text/plain), 2.13 KB, created by
Jared Camins-Esakov
on 2012-10-16 09:20:23 UTC
(
hide
)
Description:
Bug 8890: C4/HoldsQueue requires DB
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-10-16 09:20:23 UTC
Size:
2.13 KB
patch
obsolete
>From 86471bdf2ed045564c9f93c3134c7ec685eeb630 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Tue, 16 Oct 2012 04:45:43 -0400 >Subject: [PATCH] Bug 8890: C4/HoldsQueue requires DB > >This counter-patch moves all database handling code into subroutines >in C4::HoldsQueue. This fixes the test, and is required for persistent >environments like Plack. >--- > C4/HoldsQueue.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 608732f..7d38963 100755 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -48,8 +48,6 @@ BEGIN { > ); > } > >-# XXX This is not safe in a persistant environment >-my $dbh = C4::Context->dbh; > > =head1 FUNCTIONS > >@@ -62,6 +60,7 @@ Returns Transport Cost Matrix as a hashref <to branch code> => <from branch code > =cut > > sub TransportCostMatrix { >+ my $dbh = C4::Context->dbh; > my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} }); > > my %transport_cost_matrix; >@@ -86,6 +85,7 @@ Records: { frombranch => <code>, tobranch => <code>, cost => <figure>, disable_t > > sub UpdateTransportCostMatrix { > my ($records) = @_; >+ my $dbh = C4::Context->dbh; > > my $sth = $dbh->prepare("INSERT INTO transport_cost (frombranch, tobranch, cost, disable_transfer) VALUES (?, ?, ?, ?)"); > >@@ -116,6 +116,7 @@ Returns hold queue for a holding branch. If branch is omitted, then whole queue > > sub GetHoldsQueueItems { > my ($branchlimit) = @_; >+ my $dbh = C4::Context->dbh; > > my @bind_params = (); > my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber >@@ -154,6 +155,7 @@ Top level function that turns reserves into tmp_holdsqueue and hold_fill_targets > =cut > > sub CreateQueue { >+ my $dbh = C4::Context->dbh; > > $dbh->do("DELETE FROM tmp_holdsqueue"); # clear the old table for new info > $dbh->do("DELETE FROM hold_fill_targets"); >-- >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 8890
:
12739
|
12843
|
12844
|
12846
|
12847
|
12872
|
12873
|
12874
|
13014