Bug 17964: Replace next with last
We certainly always want to retrieve the last row of a given search. If it not sufficient we will need to rethink this code. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
9a8394866f
commit
5f3e93c6f5
1 changed files with 3 additions and 3 deletions
|
@ -1589,9 +1589,9 @@ sub _get_tt_params {
|
|||
foreach my $key ( @$fk ) {
|
||||
$search->{$key} = $id->{$key};
|
||||
}
|
||||
$object = $module->search( $search )->next();
|
||||
$object = $module->search( $search )->last();
|
||||
} else { # Foreign key is single column
|
||||
$object = $module->search( { $fk => $id } )->next();
|
||||
$object = $module->search( { $fk => $id } )->last();
|
||||
}
|
||||
} else { # using the table's primary key for lookup
|
||||
$object = $module->find($id);
|
||||
|
@ -1601,7 +1601,7 @@ sub _get_tt_params {
|
|||
else { # $ref eq 'ARRAY'
|
||||
my $object;
|
||||
if ( @{ $tables->{$table} } == 1 ) { # Param is a single key
|
||||
$object = $module->search( { $pk => $tables->{$table} } )->next();
|
||||
$object = $module->search( { $pk => $tables->{$table} } )->last();
|
||||
}
|
||||
else { # Params are mutliple foreign keys
|
||||
croak "Multiple foreign keys (table $table) should be passed using an hashref";
|
||||
|
|
Loading…
Reference in a new issue