Bugzilla – Attachment 117453 Details for
Bug 27708
Cannot create EDI order if AcqCreateItem value is not "placing an order"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27708: unify two item object creation blocks to be stored as hash
Bug-27708-unify-two-item-object-creation-blocks-to.patch (text/plain), 3.06 KB, created by
Peter Vashchuk
on 2021-03-01 14:20:39 UTC
(
hide
)
Description:
Bug 27708: unify two item object creation blocks to be stored as hash
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2021-03-01 14:20:39 UTC
Size:
3.06 KB
patch
obsolete
>From 4f2db9716355eb054678589fa431389f1ece2627 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Mon, 1 Mar 2021 16:19:34 +0200 >Subject: [PATCH] Bug 27708: unify two item object creation blocks to be stored > as hash > >Previously for existing item data was stored as an object and >then treated as one, but in the former item data was stored as >hash keys in the same variable so later it was treated like an object, >hence why it crashed. This patch unifies that variable in both cases >filled as hash and treated as such. > >To reproduce: > 1) Go to "Administration->System preferences" and change >"AcqCreateItem" to "receiving an order." > 2) Now, go to "Acquisitions" and create a new Vendor, >or use an existing one. > 3) Next, go to "Administration->EDI Account" and add EDI account >(pick that Vendor that you created recently, or the one that you will >use for this test). > 4) Also in "Administration->Library EANs" add EAN if you didn't >have one previously. > 5) Go back to "Acquisitions" and add a new basket to your Vendor >that you will use for this test. > 6) Press "Create EDIFACT order" button. It should throw >"Can't call method "homebranch" on unblessed reference..." >software error. > 7) Apply the patch. > 8) Reload the page that threw software error previously >(or repeat steps 5, 6 if you need another basket), >it should go through now. >--- > Koha/Edifact/Order.pm | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > >diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm >index b5434872ae..7c96365c62 100644 >--- a/Koha/Edifact/Order.pm >+++ b/Koha/Edifact/Order.pm >@@ -385,14 +385,19 @@ sub order_line { > foreach my $item (@linked_itemnumbers) { > my $i_obj = $schema->resultset('Item')->find( $item->itemnumber ); > if ( defined $i_obj ) { >- push @items, $i_obj; >+ push @items, { >+ branchcode => $i_obj->homebranch->branchcode, >+ itype => $i_obj->itype, >+ location => $i_obj->location, >+ itemcallnumber => $i_obj->itemcallnumber, >+ }; > } > } > } > else { > my $item_hash = { >- itemtype => $biblioitem->itemtype, >- shelfmark => $biblioitem->cn_class, >+ itype => $biblioitem->itemtype, >+ itemcallnumber => $biblioitem->cn_class, > }; > my $branch = $orderline->basketno->deliveryplace; > if ($branch) { >@@ -411,10 +416,10 @@ sub order_line { > for my $item (@items) { > push @{$item_fields}, > { >- branchcode => $item->homebranch->branchcode, >- itype => $item->itype, >- location => $item->location, >- itemcallnumber => $item->itemcallnumber, >+ branchcode => $item->{branchcode}, >+ itype => $item->{itype}, >+ location => $item->{location}, >+ itemcallnumber => $item->{itemcallnumber}, > }; > } > $self->add_seg( >-- >2.28.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 27708
:
117453
|
117455
|
117568
|
117665
|
117722
|
117723
|
127227
|
127228
|
127229
|
127233
|
127234
|
127264