From ddf5c7a30c6d476af5dbf1ee8dd2d5ec54aac089 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Thu, 26 Jan 2017 15:43:04 +1300 Subject: [PATCH] Bug 17944 - Tidied the DBIx code in itemtypes.pl --- admin/itemtypes.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index fd2bded..e926418 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -140,13 +140,10 @@ if ( $op eq 'add_form' ) { } elsif ( $op eq 'delete_confirm' ) { - my $context = C4::Context->new; my $schema = Koha::Database->new()->schema(); - my $itemtotal = $schema->resultset('Item')->search({ 'itype' => $itemtype_code} ); - my $bibliototal = $schema->resultset('Biblioitem')->search({ 'itemtype' => $itemtype_code} ); + my $itemtotal = $schema->resultset('Item')->search({ 'itype' => $itemtype_code})->count; + my $bibliototal = $schema->resultset('Biblioitem')->search({ 'itemtype' => $itemtype_code})->count; - $itemtotal->count; - $bibliototal->count; my $overalltotal = $itemtotal + $bibliototal; if ($overalltotal) { -- 2.1.4