Bug 30979: Fix regression

This patch fixes a regression introduced by the 'Fix public availability
500' follow-up.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass! Tests are useful!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-07-14 10:20:27 -03:00
parent 0a0b1eb68b
commit d0ef15717f
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -160,9 +160,12 @@ sub get_availability {
my ( $impossible, $confirmation, $warnings ) =
$c->_check_availability( $patron, $item );
my $confirm_keys = join( ":", sort keys %{$confirmation} );
$confirm_keys = $user ? $user->id : '' . ":" . $item->id . ":" . $confirm_keys;
my $token = Koha::Token->new->generate_jwt( { id => $confirm_keys } );
my @confirm_keys = sort keys %{$confirmation};
unshift @confirm_keys, $item->id;
unshift @confirm_keys, $user->id
if $user;
my $token = Koha::Token->new->generate_jwt( { id => join( ':', @confirm_keys ) } );
my $response = {
blockers => $impossible,