Bugzilla – Attachment 107501 Details for
Bug 26082
Follow up to bug 23463 - need to call Koha::Item store to get itemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised patch to add calls to store when new items are created so that valid itemnumber is returned
0001-Bug-26082-Call-store-on-new-items-to-update-itemnumb.patch (text/plain), 2.41 KB, created by
Colin Campbell
on 2020-07-29 13:43:52 UTC
(
hide
)
Description:
Revised patch to add calls to store when new items are created so that valid itemnumber is returned
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2020-07-29 13:43:52 UTC
Size:
2.41 KB
patch
obsolete
>From b939a1bfd8a41989e3ed65cec3bf2f368dc17c09 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Wed, 29 Jul 2020 13:23:14 +0100 >Subject: [PATCH] Bug 26082 - Call store on new items to update itemnumber > >Need to add call to store to Koha::Item->new so that itemnumber >is returned - otherwise is not defined and causes an error >Bug is a side-effect of Bug 23463 as this was implicitly >done in AddItem > >Also set biblioitemnumber explicitly for item adds this also >used to be done explicitly but can now cause an FK error >--- > Koha/EDI.pm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index a692da146b..3b89d4e5f4 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -719,7 +719,8 @@ sub quote_item { > my $created = 0; > while ( $created < $order_quantity ) { > $item_hash->{biblionumber} = $bib->{biblionumber}; >- my $item = Koha::Item->new( $item_hash ); >+ $item_hash->{biblioitemnumber} = $bib->{biblioitemnumber}; >+ my $item = Koha::Item->new( $item_hash )->store; > my $itemnumber = $item->itemnumber; > $logger->trace("Added item:$itemnumber"); > $schema->resultset('AqordersItem')->create( >@@ -810,7 +811,8 @@ sub quote_item { > } > > $item_hash->{biblionumber} = $bib->{biblionumber}; >- my $item = Koha::Item->new( $item_hash ); >+ $item_hash->{biblioitemnumber} = $bib->{biblioitemnumber}; >+ my $item = Koha::Item->new( $item_hash )->store; > my $itemnumber = $item->itemnumber; > $logger->trace("New item $itemnumber added"); > $schema->resultset('AqordersItem')->create( >@@ -879,7 +881,8 @@ sub quote_item { > homebranch => $item->girfield( 'branch', $occurrence ), > }; > $new_item->{biblionumber} = $bib->{biblionumber}; >- my $item = Koha::Item->new( $new_item ); >+ $new_item->{biblioitemnumber} = $bib->{biblioitemnumber}; >+ my $item = Koha::Item->new( $new_item )->store; > my $itemnumber = $item->itemnumber; > $logger->trace("New item $itemnumber added"); > $schema->resultset('AqordersItem')->create( >-- >2.26.2 >
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 26082
:
107490
|
107501
|
108637