Bugzilla – Attachment 8904 Details for
Bug 7872
C4::Items should use C4::Koha methods instead of duplicating SQL queries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 7872 - C4::Items::GetItemsInfo marc_subfield_structure
Signed-off-Bug-7872---C4ItemsGetItemsInfo-marcsubf.patch (text/plain), 2.01 KB, created by
Alex Arnaud
on 2012-04-05 08:25:07 UTC
(
hide
)
Description:
[Signed-off] Bug 7872 - C4::Items::GetItemsInfo marc_subfield_structure
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2012-04-05 08:25:07 UTC
Size:
2.01 KB
patch
obsolete
>From c0ce2a5b279c6d642c45282f6e44db4ee64eead9 Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Mon, 2 Apr 2012 16:03:38 +0200 >Subject: [PATCH] [Signed-off] Bug 7872 - C4::Items::GetItemsInfo marc_subfield_structure > >SQL queries fetch all results and use first row. Adding frameworkcode >to SQL queries will help returning just one (correct) row, >improve performance and allow caching of values in future. > >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> >--- > C4/Items.pm | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 0b2f99b..de808e5 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1250,10 +1250,11 @@ sub GetItemsInfo { > 'SELECT authorised_value > FROM marc_subfield_structure > WHERE kohafield="items.notforloan" >+ AND frameworkcode = ? > ' > ); > >- $sthnflstatus->execute; >+ $sthnflstatus->execute( $data->{frameworkcode} ); > my ($authorised_valuecode) = $sthnflstatus->fetchrow; > if ($authorised_valuecode) { > $sthnflstatus = $dbh->prepare( >@@ -1272,10 +1273,11 @@ sub GetItemsInfo { > 'SELECT authorised_value > FROM marc_subfield_structure > WHERE kohafield="items.restricted" >+ AND frameworkcode = ? > ' > ); > >- $restrictedstatus->execute; >+ $restrictedstatus->execute( $data->{frameworkcode} ); > ($authorised_valuecode) = $restrictedstatus->fetchrow; > if ($authorised_valuecode) { > $restrictedstatus = $dbh->prepare( >@@ -1297,9 +1299,10 @@ sub GetItemsInfo { > 'SELECT authorised_value > FROM marc_subfield_structure > WHERE kohafield="items.stack" >+ AND frameworkcode = ? > ' > ); >- $stackstatus->execute; >+ $stackstatus->execute( $data->{frameworkcode} ); > > ($authorised_valuecode) = $stackstatus->fetchrow; > if ($authorised_valuecode) { >-- >1.7.0.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 7872
:
8774
|
8904
|
8917
|
8923
|
9993