We add a safety check in the function
Application/Acq/Order.pm/create_lineitem_list_assets(), which is called
by create_po_assets(), which is the service call initiated by the user
trying to activate a PO.
The safety check prevents the function from processing if there are no
line items specified in the arguments.
P.S. It would be better to stop the sequence of events earlier in the
client, but that will need more coding, which can been done in another
fix.
Signed-off-by: Steven Chan <schan@sitka.bclibraries.ca>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
sub create_lineitem_list_assets {
my($mgr, $li_ids, $vandelay, $bib_only) = @_;
+ # Do not create line items if none are specified
+ return {} unless (scalar(@$li_ids));
+
if (check_import_li_marc_perms($mgr, $li_ids)) { # event on error
$logger->error("acq-vl: user does not have permission to import acq records");
return undef;