From 81ce189f4623e62109bdc5bbcbcc9ba8c48e4dd5 Mon Sep 17 00:00:00 2001 From: Steven Chan Date: Sat, 15 Jun 2013 13:06:43 -0400 Subject: [PATCH] Fix LP1177916, Cannot activate PO which contains only direct charges 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 Signed-off-by: Kathy Lussier Signed-off-by: Jason Stephenson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index e813cd9db3..1a774d8bb5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -299,6 +299,9 @@ sub delete_lineitem { 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; -- 2.43.2