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

Evergreen Git git at git.evergreen-ils.org
Wed Jun 19 15:19:10 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, master has been updated
       via  d273da4d53d1b8763c8864401503532ed77e1e48 (commit)
      from  aae36eabf72fb037ed54d8b24146723230e669aa (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 d273da4d53d1b8763c8864401503532ed77e1e48
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jun 17 00:38:43 2013 -0400

    Support script-based circ in nearest_hold()
    
    The nearest_hold() implementation recently changed to pull in the circ
    library ID; however, if circulation runs through scripts, the circ
    library on the copy object has been fleshed, and the nearest hold
    routine gets very confused.
    
    Check to see if we do, in fact, have an object instead of a plain
    scalar, and assign the value to a placeholder variable accordingly.
    
    Thanks to Jeff Godin for his great assistance on debugging this!
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    
    Conflicts:
    	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
    
    (Just whitespace. Resolved by hand.  --miker)

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index 42e5e84..7acb5fb 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -49,7 +49,7 @@ my %HOLD_SORT_ORDER_BY = (
 
 
 sub isTrue {
-    my $v = shift;
+    my $v = shift || '0';
     return 1 if ($v == 1);
     return 1 if ($v =~ /^t/io);
     return 1 if ($v =~ /^y/io);
@@ -504,14 +504,23 @@ sub nearest_hold {
     my $age = shift() || '0 seconds';
     my $fifo = shift();
 
-    $log->info("deprecated 'fifo' param true, but ignored") if isTrue $fifo;
+    $log->info("deprecated 'fifo' param true, but ignored") if isTrue($fifo);
+
+    # ScriptBuilder fleshes the circ_lib, which confuses things; ensure we
+    # are working with a circ lib ID and not an object
+    my $cp_circ_lib;
+    if (ref $cp->circ_lib) {
+        $cp_circ_lib = $cp->circ_lib->id;
+    } else {
+        $cp_circ_lib = $cp->circ_lib;
+    }
 
     my ($holdsort, $addl_cte, $addl_join) =
         build_hold_sort_clause(get_hold_sort_order($here), $cp, $here);
 
     local $OpenILS::Application::Storage::WRITE = 1;
 
-    my $ids = action::hold_request->db_Main->selectcol_arrayref(<<"    SQL", {}, $cp->circ_lib, $here, $cp->id, $age);
+    my $ids = action::hold_request->db_Main->selectcol_arrayref(<<"    SQL", {}, $cp_circ_lib, $here, $cp->id, $age);
         WITH go_home_interval AS (
             SELECT OILS_JSON_TO_TEXT(
                 (SELECT value FROM actor.org_unit_ancestor_setting(

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

Summary of changes:
 .../Application/Storage/Publisher/action.pm        |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list