[Koha-bugs] [Bug 17944] Remove the sql code from itemtypes.pl administrative perl script

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 5 03:55:16 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17944

--- Comment #44 from Alex Buckley <alexbuckley at catalyst.net.nz> ---
Hi Jonathan

I have implemented the changes you suggested in a single patch for bug 17944.

Because I have implemented the following return line (which you suggested) from
can_be_deleted() subroutine:

return $nb_items + $nb_biblioitems == 0;

I had to slightly change the unit test from how you suggested it, this is
because whenever there were items and/or biblioitems with the itemtype it meant
that ' ' was returned. So the unit test callers are now:
is( $item_type->can_be_deleted, '', 'An item type that is used by an item
cannot be deleted' );

is ( $item_type->can_be_deleted, '', 'An item type that is used by a biblioitem
cannot be deleted' );

Additionally as '' is returned if the itemtype is in use, rather than the
number of items and biblioitems using the itemtype I have changed itemtypes.tt
to saying:

Cannot delete this item type.

This record is in use. Deletion is not possible.

If you would still like the number of items and biblioitems using the itemtype
to be displayed to the user in itemtypes.tt then I will need to change the
return for can_be_deleted to a longer if else statement.

Could you please have a look at this patch?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list