]> git.koha-community.org Git - koha.git/commit
Bug 27708: Unify two item object creation blocks to be stored as hash
authorPetro Vashchuk <stalkernoid@gmail.com>
Wed, 3 Mar 2021 12:34:52 +0000 (14:34 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 12 Nov 2021 23:15:24 +0000 (13:15 -1000)
commitb6a792b14fd0abee3643a3f1c9e024c9415aa332
treedfd8dd82adfc032fc9a470c2ad560de98ba50e64
parentcf83510d47d6dc60bf30ad4586515838724bf38e
Bug 27708: Unify two item object creation blocks to be stored as hash

Previously for existing item data was stored as an object reference and
then treated as one, but for not yet existing item data was stored as
keys in hash reference in the same variable and later it was treated
like an object, hence why it crashed with "no method".
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.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e429519974bb7bd8125fa0194bb7a7a004c638ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Edifact/Order.pm