[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. 0aa79fe3f10b8b2c235167b69d9ce72018ef4349

Evergreen Git git at git.evergreen-ils.org
Wed Jul 17 13:58:41 EDT 2013


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, rel_2_4 has been updated
       via  0aa79fe3f10b8b2c235167b69d9ce72018ef4349 (commit)
      from  514f5db19fe344bd2dde184a8c96f875ec2e1b88 (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 0aa79fe3f10b8b2c235167b69d9ce72018ef4349
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Jul 16 16:58:57 2013 -0400

    Optimize away always-true hold count clause
    
    When rendering results in the tpac we request hold counts for each record.
    Most of the time (that is, whenever org unit hiding is /not/ in use) we
    filter, essentially, on "where pickup_lib is in the org tree".  This is
    both useless and slow, so this commit will recognize that and optimize the
    test away.
    
    [LFW: fixed typo]
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index d63f907..ab357a9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -4061,6 +4061,11 @@ sub rec_hold_count {
 
 
     if (my $pld = $args->{pickup_lib_descendant}) {
+
+        my $top_ou = new_editor()->search_actor_org_unit(
+            {parent_ou => undef}
+        )->[0]; # XXX Assumes single root node. Not alone in this...
+
         $query->{where}->{'+ahr'}->{pickup_lib} = {
             in => {
                 select  => {aou => [{ 
@@ -4071,7 +4076,7 @@ sub rec_hold_count {
                 from    => 'aou',
                 where   => {id => $pld}
             }
-        };
+        } if ($pld != $top_ou->id);
     }
 
 

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list