From 726bf2c663711d80e73614a7e2ec40f7ea1b1aec Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 7 Jun 2017 13:24:41 -0400 Subject: [PATCH] Bug 18750: t/db_dependent/Circulation/Branch.t fails TEST PLAN --------- prove -v t/db_dependent/Circulation/Branch.t -- nice kaboom apply patch prove -v t/db_dependent/Circulation/Branch.t -- everything passes run koha qa test tools BIG DISCLAIMER EXPLAINING IN DISCUSSION STATUS: Look for 'WrongBranch' vs 'NeedsTransfer' logic elsewhere I have not spent time doing this, which is why this is 'In Discussion'. If it is fully confirmed that it does not break anywhere else, then and only then feel free to sign off. --- C4/Circulation.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a439021..3785577 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1904,12 +1904,15 @@ sub AddReturn { # check if the return is allowed at this branch my ($returnallowed, $message) = CanBookBeReturned($item, $branch); unless ($returnallowed){ - $messages->{'Wrongbranch'} = { - Wrongbranch => $branch, - Rightbranch => $message - }; - $doreturn = 0; - return ( $doreturn, $messages, $issue, $borrower ); + my ($recheckallowed, $secondary_message) = CanBookBeReturned($item, $message); + unless ($recheckallowed) { + $messages->{'Wrongbranch'} = { + Wrongbranch => $branch, + Rightbranch => $message + }; + $doreturn = 0; + return ( $doreturn, $messages, $issue, $borrower ); + } } if ( $item->{'withdrawn'} ) { # book has been cancelled -- 2.1.4