From 0f090c3049545e335885aa8e7ff76742aa157ed9 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 --- 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 7313471914..b141a23c16 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.11.0