The added calls to Koha::Item use a temporary variable called $item to store their return this hides the existing variable $item which is the lineitem being processed. Calling lineitem methods on it causes an error
Created attachment 109966 [details] [review] patch to give the Koha::Item returns a unique name This renames all the Koha::Item->new returns to $kitem so as not to hide the $item variable (one case had a more restricted scope but this will guard against it causing the problem if the logic changes)
Should this be a bug instead of an enh?
(In reply to Katrin Fischer from comment #2) > Should this be a bug instead of an enh? Yes - think value reset in entry and I didnt check
Created attachment 110590 [details] [review] Bug 26438: Rename temporary Koha::Item variables to avoid conflict Returns from Koha::Item calls were stored in temporary variables called $item. Unfortunately they occur in routines already with an $item variable holding a lineitem and hide that variable although only required for two lines of code. An error occurs if girfield is called on the wrong variable. Renamed all three occurences of $item to $kitem to avoid the error Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 110631 [details] [review] Bug 26438: Rename temporary Koha::Item variables to avoid conflict Returns from Koha::Item calls were stored in temporary variables called $item. Unfortunately they occur in routines already with an $item variable holding a lineitem and hide that variable although only required for two lines of code. An error occurs if girfield is called on the wrong variable. Renamed all three occurences of $item to $kitem to avoid the error Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
As this was a side effect from another bug and is a major issue, I think we should push as is, but it would be really great to have some unit tests for EDI!
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.05
missing dependencies, not backported to 19.11.x