Bugzilla – Attachment 95413 Details for
Bug 24027
Adding multiple items is slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24027: dbh handler not passed through all chain
Bug-24027-dbh-handler-not-passed-through-all-chain.patch (text/plain), 2.45 KB, created by
Andrii Nugged
on 2019-11-13 22:57:42 UTC
(
hide
)
Description:
Bug 24027: dbh handler not passed through all chain
Filename:
MIME Type:
Creator:
Andrii Nugged
Created:
2019-11-13 22:57:42 UTC
Size:
2.45 KB
patch
obsolete
>From 0e745c4207991853dd0884700479cfeb10513694 Mon Sep 17 00:00:00 2001 >From: Andrew Nugged <nugged@gmail.com> >Date: Thu, 14 Nov 2019 00:33:59 +0200 >Subject: [PATCH] Bug 24027: dbh handler not passed through all chain > >preparatory fix for next patch to have all parameters aligned: >$dbh handler passed through as parameter in AddItem but >forgotten in AddItemFromMarc. Added. >--- > C4/Items.pm | 7 ++++--- > cataloguing/additem.pl | 4 ++-- > 2 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index b81fb0aa17..eb46859c24 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -144,7 +144,7 @@ sub CartToShelf { > =head2 AddItemFromMarc > > my ($biblionumber, $biblioitemnumber, $itemnumber) >- = AddItemFromMarc($source_item_marc, $biblionumber); >+ = AddItemFromMarc($source_item_marc, $biblionumber[, $dbh]); > > Given a MARC::Record object containing an embedded item > record and a biblionumber, create a new item record. >@@ -152,8 +152,9 @@ record and a biblionumber, create a new item record. > =cut > > sub AddItemFromMarc { >- my ( $source_item_marc, $biblionumber ) = @_; >- my $dbh = C4::Context->dbh; >+ my $source_item_marc = shift; >+ my $biblionumber = shift; >+ my $dbh = @_ ? shift : C4::Context->dbh; > > # parse item hash from MARC > my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 2c371def28..eded25fc5f 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -501,7 +501,7 @@ if ($op eq "additem") { > > # if barcode exists, don't create, but report The problem. > unless ($exist_itemnumber) { >- my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber ); >+ my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber, $dbh ); > set_item_default_location($oldbibitemnum); > > # Pushing the last created item cookie back >@@ -600,7 +600,7 @@ if ($op eq "additem") { > > # Adding the item > if (!$exist_itemnumber) { >- my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc($record,$biblionumber); >+ my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc( $record, $biblionumber, $dbh); > set_item_default_location($oldbibitemnum); > > # We count the item only if it was really added >-- >2.17.1
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 24027
:
95413
|
95414
|
95417
|
95446
|
95473
|
95663
|
98250
|
98251
|
98252
|
98253
|
102464
|
102474
|
102567
|
102568
|
102572
|
102578
|
102579
|
102580