Bug 19487: Refetch the object to get up-to-date values
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 20 Oct 2017 18:56:20 +0000 (15:56 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 20 Oct 2017 18:58:20 +0000 (15:58 -0300)
This has been raised by failures on t/db_dependent/Circulation/issue.t
(thanks tests!)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm

index 18d9a44..48d768b 100644 (file)
@@ -2170,6 +2170,9 @@ sub MarkIssueReturned {
         # Update the returndate
         $dbh->do( $query, undef, @bind );
 
+        # We just updated the returndate, so we need to refetch $issue
+        $issue->discard_changes;
+
         # Create the old_issues entry
         my $old_checkout = Koha::Old::Checkout->new($issue->unblessed)->store;