Bug 29562: (follow-up) Fix API controller
This patch fixes tests failures due to bad checks in the controller. The tests deserve to be rewritten. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
842d448276
commit
ad13fee5fb
|
|
@ -388,7 +388,7 @@ sub CanItemBeReserved {
|
|||
|
||||
# we retrieve borrowers and items informations #
|
||||
# item->{itype} will come for biblioitems if necessery
|
||||
my $biblio = $item->biblio;
|
||||
my $biblio = $item->biblio;
|
||||
my $borrower = $patron->unblessed;
|
||||
|
||||
# If an item is damaged and we don't allow holds on damaged items, we can stop right here
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ sub add {
|
|||
) unless $valid_pickup_location || $can_override;
|
||||
|
||||
my $can_place_hold
|
||||
= $item_id
|
||||
= $item
|
||||
? C4::Reserves::CanItemBeReserved( $patron, $item )
|
||||
: C4::Reserves::CanBookBeReserved( $patron_id, $biblio_id );
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ sub add {
|
|||
{
|
||||
branchcode => $pickup_library_id,
|
||||
borrowernumber => $patron_id,
|
||||
biblionumber => $biblio_id,
|
||||
biblionumber => $biblio->id,
|
||||
priority => $priority,
|
||||
reservation_date => $hold_date,
|
||||
expiration_date => $expiration_date,
|
||||
|
|
|
|||
Loading…
Reference in New Issue