[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. 1c95061213c27f7969013cd9a58abdb35db89a96

Evergreen Git git at git.evergreen-ils.org
Wed Jun 19 15:19:53 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  1c95061213c27f7969013cd9a58abdb35db89a96 (commit)
      from  02c546a31aa5883a991258e850ed5a25eb313973 (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 1c95061213c27f7969013cd9a58abdb35db89a96
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>

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 16e698f..f19f1b1 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