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@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
} 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';