Bugzilla – Attachment 45838 Details for
Bug 14598
itemtype is not set on statistics by C4::Circulation::AddReturn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14598 [QA Followup] - Correct the behavior of GetItem
Bug-14598-QA-Followup---Correct-the-behavior-of-Ge.patch (text/plain), 2.78 KB, created by
Kyle M Hall (khall)
on 2015-12-18 15:00:38 UTC
(
hide
)
Description:
Bug 14598 [QA Followup] - Correct the behavior of GetItem
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-12-18 15:00:38 UTC
Size:
2.78 KB
patch
obsolete
>From adb60ae69d71961b6633b0bc40b96c208719e327 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 18 Dec 2015 14:59:02 +0000 >Subject: [PATCH] Bug 14598 [QA Followup] - Correct the behavior of GetItem > >Currently GetItem sets itemtype to the biblio itemtype if no item level >itemtype exists. Instead, it should only do this if item_level-itypes >is not set. >--- > C4/Items.pm | 34 +++++++++++++++++----------------- > 1 file changed, 17 insertions(+), 17 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index a7db6ef..4f4b408 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -149,38 +149,38 @@ names to values. If C<$serial> is true, include serial publication data. > sub GetItem { > my ($itemnumber,$barcode, $serial) = @_; > my $dbh = C4::Context->dbh; >- my $data; >+ my $data; > > if ($itemnumber) { > my $sth = $dbh->prepare(" >- SELECT * FROM items >+ SELECT * FROM items > WHERE itemnumber = ?"); > $sth->execute($itemnumber); > $data = $sth->fetchrow_hashref; > } else { > my $sth = $dbh->prepare(" >- SELECT * FROM items >+ SELECT * FROM items > WHERE barcode = ?" > ); >- $sth->execute($barcode); >+ $sth->execute($barcode); > $data = $sth->fetchrow_hashref; > } > > return unless ( $data ); > >- if ( $serial) { >- my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=?"); >- $ssth->execute($data->{'itemnumber'}) ; >- ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); >- } >- #if we don't have an items.itype, use biblioitems.itemtype. >- # FIXME this should respect the itypes systempreference >- # if (C4::Context->preference('item-level_itypes')) { >- if( ! $data->{'itype'} ) { >- my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); >- $sth->execute($data->{'biblionumber'}); >- ($data->{'itype'}) = $sth->fetchrow_array; >- } >+ if ($serial) { >+ my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=?"); >+ $ssth->execute( $data->{'itemnumber'} ); >+ ( $data->{'serialseq'}, $data->{'publisheddate'} ) = $ssth->fetchrow_array(); >+ } >+ >+ # Set the itype to biblioitems.itype unless we are using item level itypes >+ unless ( C4::Context->preference('item-level_itypes') ) { >+ my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); >+ $sth->execute( $data->{'biblionumber'} ); >+ ( $data->{'itype'} ) = $sth->fetchrow_array; >+ } >+ > return $data; > } # sub GetItem > >-- >1.7.10.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 14598
:
41198
|
41199
|
41200
|
41201
|
41202
|
41203
|
41204
|
41205
|
41383
|
41384
|
41385
|
41627
|
41628
|
41629
|
41637
|
42171
|
42177
|
44665
|
44666
|
44667
|
44668
|
45030
|
45047
|
45838
|
45843
|
45844
|
46546
|
46877
|
47108
|
47109
|
47110
|
47111
|
47112
|
47113
|
47114
|
47115
|
47116
|
49797
|
49798
|
49799
|
49800
|
49801
|
49802
|
49803
|
49804
|
49805
|
49807
|
49963
|
49964
|
49965
|
49966
|
49967
|
49968
|
49969
|
49970
|
49971
|
49972
|
49978
|
49979
|
49980
|
49981
|
49982
|
49983
|
49984
|
49985
|
49986
|
49987
|
49988
|
50018
|
56941
|
56942
|
56943
|
56944
|
56945
|
56946
|
56947
|
56948
|
56949
|
56950
|
56951
|
56952
|
56953
|
62539
|
62555
|
62682