[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 02349cafced289943d547a5711de17fcba92cee0

Evergreen Git git at git.evergreen-ils.org
Wed Oct 19 16:00:07 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, rel_2_1 has been updated
       via  02349cafced289943d547a5711de17fcba92cee0 (commit)
      from  26d0bc0701527e5ab600a085fe165387f43b9c9a (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 02349cafced289943d547a5711de17fcba92cee0
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Oct 19 13:42:16 2011 -0400

    CStoreEditor batch_retrieve repairs
    
    1. If the caller provides additional cstore params, like flesh,
    flesh_fields, etc. make sure we only use the first component of the
    search (the list of identifier values) for the cstore search.
    
    2. Determine the identifier field from the class being retrieved instead
    of hard-coding it to be "id"
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
index 03237ca..c137829 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
@@ -694,9 +694,20 @@ sub runmethod {
 
 	} elsif( $action eq 'batch_retrieve' ) {
 		$action = 'search';
-		@arg = ( { id => $arg } );
 		$method =~ s/batch_retrieve/search/o;
 		$method .= '.atomic';
+		my $tt = $type;
+		$tt =~ s/\./::/og;
+		my $fmobj = "Fieldmapper::$tt";
+		my $ident_field = $fmobj->Identity;
+
+		if (ref $arg[0] eq 'ARRAY') {
+			# $arg looks like: ([1, 2, 3], {search_args})
+			@arg = ( { $ident_field => $arg[0] }, @arg[1 .. $#arg] );
+		} else {
+			# $arg looks like: [1, 2, 3]
+			@arg = ( { $ident_field => $arg } );
+		}
 
 	} elsif( $action eq 'retrieve_all' ) {
 		$action = 'search';

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list