https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17944 --- Comment #9 from Alex Buckley <alexbuckley@catalyst.net.nz> --- So before I attach the new commit just to check would you be happy with this? my $schema = Koha::Database->new()->schema(); my $itemtotal = $schema->resultset('Item')->search({ 'itype' => $itemtype_code})->count; my $bibliototal = $schema->resultset('Biblioitem')->search({ 'itemtype' => $itemtype_code})->count; my $overalltotal = $itemtotal + $bibliototal; if ($overalltotal) { push @messages, { type => 'error', code => 'cannot_be_deleted', total => $overalltotal }; $op = 'list'; } else { my $itemtype = Koha::ItemTypes->find($itemtype_code); $template->param( itemtype => $itemtype, ); } I have tested it and it outputs the correct value -- You are receiving this mail because: You are watching all bug changes.