[open-ils-commits] [GIT] Evergreen ILS branch master updated. d11c07ae59a6a34215aab2dfd76b785eb9c2e388

Evergreen Git git at git.evergreen-ils.org
Wed Oct 26 17:17:02 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  d11c07ae59a6a34215aab2dfd76b785eb9c2e388 (commit)
      from  beda681b74c9ca4a753388ff14a6ec17b846a20d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d11c07ae59a6a34215aab2dfd76b785eb9c2e388
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Oct 6 18:06:22 2011 -0400

    Avoid a possible bug in selection list deletion
    
    This particularly matters for the "ephemeral," unnamed selection list that
    Acquisitions General Search uses to hold bib records represented as
    lineitems, as that list is deleted for the next run of that kind of
    search.
    
    It's possible to get lineitems onto that list that are in a state
    other than "new".  Code that deletes this list first deletes the
    lineitems that belong to it, but that code formerly assumed that there
    are two types of lineitems. "new" ones (that should be deleted) and ones
    that belong to purchase orders (that should be deatched).  That doesn't
    necessarily cover all possible lineitems on the picklist, so deletion
    ultimately fails.
    
    This fixes that.
    
    [update: now this bugfix incorporates a bugfix, the need for which was
    detected by Ben Shum. See LP #869581]
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

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 7313cc1..8e478ca 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
@@ -855,7 +855,13 @@ sub delete_picklist {
     $picklist = $mgr->editor->retrieve_acq_picklist($picklist) unless ref $picklist;
 
     # delete all 'new' lineitems
-    my $li_ids = $mgr->editor->search_acq_lineitem({picklist => $picklist->id, state => 'new'}, {idlist => 1});
+    my $li_ids = $mgr->editor->search_acq_lineitem(
+        {
+            picklist => $picklist->id,
+            "-or" => {state => "new", purchase_order => undef}
+        },
+        {idlist => 1}
+    );
     for my $li_id (@$li_ids) {
         my $li = $mgr->editor->retrieve_acq_lineitem($li_id);
         return 0 unless delete_lineitem($mgr, $li);

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Acq/Order.pm  |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list