Bugzilla – Attachment 64990 Details for
Bug 18851
Use Test::DBIx::Class in tests breaks packaging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18851: Database handler must not be created at runtime
Bug-18851-Database-handler-must-not-be-created-at-.patch (text/plain), 2.18 KB, created by
Mirko Tietgen
on 2017-07-11 10:58:04 UTC
(
hide
)
Description:
Bug 18851: Database handler must not be created at runtime
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2017-07-11 10:58:04 UTC
Size:
2.18 KB
patch
obsolete
>From 28036d6721c72cff6775df3e4dde228fb3e342f9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Jul 2017 17:37:41 -0300 >Subject: [PATCH] Bug 18851: Database handler must not be created at runtime > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > Koha/Patron/Discharge.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm >index 580d4d1..06e3101 100644 >--- a/Koha/Patron/Discharge.pm >+++ b/Koha/Patron/Discharge.pm >@@ -13,8 +13,6 @@ use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Patrons; > >-my $rs = Koha::Database->new->schema->resultset('Discharge'); >- > sub count { > my ($params) = @_; > my $values = {}; >@@ -30,6 +28,7 @@ sub count { > $values->{validated} = { '!=', undef }; > } > >+ my $rs = Koha::Database->new->schema->resultset('Discharge'); > return $rs->search( $values )->count; > } > >@@ -67,6 +66,7 @@ sub request { > return unless $borrowernumber; > return unless can_be_discharged({ borrowernumber => $borrowernumber }); > >+ my $rs = Koha::Database->new->schema->resultset('Discharge'); > return $rs->create({ > borrower => $borrowernumber, > needed => dt_from_string, >@@ -92,6 +92,7 @@ sub discharge { > }); > > # Generate the discharge >+ my $rs = Koha::Database->new->schema->resultset('Discharge'); > my $discharge = $rs->search({ borrower => $borrowernumber }, { order_by => { -desc => 'needed' }, rows => 1 }); > if( $discharge->count > 0 ) { > $discharge->update({ validated => dt_from_string }); >@@ -163,6 +164,7 @@ sub get_pendings { > ( defined $branchcode ? ( 'borrower.branchcode' => $branchcode ) : () ), > }; > >+ my $rs = Koha::Database->new->schema->resultset('Discharge'); > my @rs = $rs->search( $cond, { join => 'borrower' } ); > return \@rs; > } >@@ -178,6 +180,7 @@ sub get_validated { > ( defined $branchcode ? ( 'borrower.branchcode' => $branchcode ) : () ), > }; > >+ my $rs = Koha::Database->new->schema->resultset('Discharge'); > my @rs = $rs->search( $cond, { join => 'borrower' } ); > return \@rs; > } >-- >2.1.4
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 18851
:
64830
|
64831
|
64832
|
64913
|
64979
|
64990
|
64991
|
64992
|
64993
|
65199
|
65368
|
65574
|
65575
|
65576
|
65577
|
65578
|
65579