Confirming a hold to set it to waiting will result in an DBIC error in
master.
Test Plan:
1) Attempt to check in an item on hold and confirm the hold
2) Note the error
3) Apply this patch
4) Repeat step 1
5) Note there is no error!
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
https://bugs.koha-community.org/show_bug.cgi?id=14942
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
my $id = ref $ref eq 'HASH' ? $tables->{$table}->{$pk} : $tables->{$table};
my $object;
if ( $fk ) { # Using a foreign key for lookup
- $object = $module->search( { $fk => $id } )->next();
+ if ( ref( $fk ) eq 'ARRAY' ) { # Foreign key is multi-column
+ my $search;
+ foreach my $key ( @$fk ) {
+ $search->{$key} = $id->{$key};
+ }
+ $object = $module->search( $search )->next();
+ } else { # Foreign key is single column
+ $object = $module->search( { $fk => $id } )->next();
+ }
} else { # using the table's primary key for lookup
$object = $module->find($id);
}