Bug 27545 expanded the use of NewItemsDefaultLocation, however, it checks for $defaultvalues undefined. There are several calls that pass '' (empty string) for default values. It is expected to be a hashref, so we should pass undef if we don't have defaults. Otherwise, we get an error when NewItemsDefaultLocation is set: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605.
Created attachment 126271 [details] [review] Bug 29243: Correct call when adding items from staged records To test: 1 - Populate system preference NewItemsDefaultLocation 2 - Stage a file of marc records 3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering' 4 - Attempt to add to basket from your staged file 5 - You get a 500 error, and in the logs: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605. 6 - Apply patch 7 - Repeat #4 8 - Success!
Created attachment 126297 [details] [review] Bug 29243: Correct call when adding items from staged records To test: 1 - Populate system preference NewItemsDefaultLocation 2 - Stage a file of marc records 3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering' 4 - Attempt to add to basket from your staged file 5 - You get a 500 error, and in the logs: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605. 6 - Apply patch 7 - Repeat #4 8 - Success! Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 126311 [details] [review] Bug 29243: Correct call when adding items from staged records To test: 1 - Populate system preference NewItemsDefaultLocation 2 - Stage a file of marc records 3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering' 4 - Attempt to add to basket from your staged file 5 - You get a 500 error, and in the logs: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605. 6 - Apply patch 7 - Repeat #4 8 - Success! Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Clear patch, works as expected. QA Scripts are happy. Passing QA
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.05
Depends on Bug 27545 not in 20.11.x