Bugzilla – Attachment 41371 Details for
Bug 12748
Serials - two issues with status of "Expected"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12748: QA Fixes
Bug-12748-QA-Fixes.patch (text/plain), 1.81 KB, created by
Jonathan Druart
on 2015-08-05 08:44:55 UTC
(
hide
)
Description:
Bug 12748: QA Fixes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-05 08:44:55 UTC
Size:
1.81 KB
patch
obsolete
>From 6864cee18313d031c7585c8bb721d1477b3583da Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Aug 2015 09:34:24 +0100 >Subject: [PATCH] Bug 12748: QA Fixes > >- Use the constant instead of the code (1 vs EXPECTED) >- Avoid interpolation in query >- use selectall_arrayref instead of fetchall_arrayref >--- > C4/Serials.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index b958241..76b8bbe 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1127,7 +1127,7 @@ sub ModSerialStatus { > > # create new expected entry if needed (ie : was "expected" and has changed) > # BUG 12748: Check if there are no other expected issues. >- my $otherIssueExpected = scalar findSerialByStatus(1, $subscriptionid); >+ my $otherIssueExpected = scalar findSerialByStatus(EXPECTED, $subscriptionid); > if ( !$otherIssueExpected && $oldstatus == EXPECTED && $status != EXPECTED ) { > my $subscription = GetSubscription($subscriptionid); > my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern}); >@@ -2740,16 +2740,16 @@ sub _can_do_on_subscription { > Returns an array of serials matching a given status and subscription id. > > =cut >+ > sub findSerialByStatus{ > my($status, $subscriptionid) = @_; > my $dbh = C4::Context->dbh; >- my $query = qq| SELECT * from serial >+ my $query = q| SELECT * from serial > WHERE status = ? > AND subscriptionid = ? > |; >- my $sth = $dbh->prepare($query); >- $sth->execute($status, $subscriptionid); >- return @{$sth->fetchall_arrayref({})}; >+ my $serials = $dbh->selectall_arrayref( $query, { Slice => {} }, $status, $subscriptionid ); >+ return @$serials; > } > 1; > __END__ >-- >2.1.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 12748
:
41228
|
41230
|
41371
|
41451
|
44533
|
46091
|
47770
|
47771
|
47773
|
47774
|
47775
|
47776
|
52356
|
52357
|
52358
|
52359
|
52360