Bug 20086: (follow-up) No need to call ->new on Koha::Database
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 17 Oct 2019 16:28:15 +0000 (17:28 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 21 Oct 2019 08:46:46 +0000 (09:46 +0100)
We should use the existing pattern of calling schema directly on
Koha::Database rather than creating a new object.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Circulation.pm

index 03b623b..2800bdf 100644 (file)
@@ -2864,7 +2864,7 @@ sub AddRenewal {
 
     my $circ_library = Koha::Libraries->find( _GetCircControlBranch($item_unblessed, $patron_unblessed) );
 
-    my $schema = Koha::Database->new->schema;
+    my $schema = Koha::Database->schema;
     $schema->txn_do(sub{
 
         if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {