As a result of using Koha::Item instead of AddItem processing of Edifact messages are aborting. When calling Koha::Item->new we need to call store in order to have a valid itemnumber returned otherwise the itemnumber is undefined causing subsequent usage of it to abort. A case in Illrequest.pm was picked up in bug 23463 the cases in EDI.pm need to be amended similarly
Created attachment 107490 [details] [review] Patch adding calls to store when new items created so that valid itemnumber is returned
Created attachment 107501 [details] [review] Revised patch to add calls to store when new items are created so that valid itemnumber is returned Add an explicit setting of biblioitemnumber to avoid store generating foreign key errors (this also used to be implicit behaviour)
Created attachment 108637 [details] [review] 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 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Those lines are not needed, but won't hurt: $item_hash->{biblioitemnumber} = $bib->{biblioitemnumber}; It's handled in Koha::Item->store. Sorry for having missed that!
Pushed to master for 20.11, thanks to everybody involved!
20.05 will need this ;)
backported to 20.05.x for 20.05.04
missing dependencies, not backported to 19.11.x