From 6591385f078cb38528be8cae3b13b16e702b1a03 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 13 Jul 2023 09:22:44 +0200 Subject: [PATCH] Bug 34266: Don't default to biblio itemtype if item-level_types is set biblioitems.itemtype and items.itype can use differents sets of values so biblioitems.itemtype can be innappropriate as a default for items.itype. This patch removes this behaviour when item-level_itypes is set Test plan: 1. Disable item-level_itypes 2. Make sure that you have an item subfield linked to the authorised value 'itemtypes' in your MARC framework 3. Create a biblio with an itemtype 4. Create a new item for this biblio. Notice that the biblio itemtype is automatically selected for the 'itemtypes' subfield 5. Enable item-level_itypes 6. Create a new item for the same biblio. Now the 'itemtypes' subfield should be empty. --- Koha/UI/Form/Builder/Item.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 3a478ee05e..ce04b66c29 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -220,7 +220,7 @@ sub generate_subfield_form { $itemtype->translated_description; } - if (!$value && $biblionumber) { + if (!$value && $biblionumber && !C4::Context->preference('item-level_itypes')) { my $itype_sth = $dbh->prepare( "SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); $itype_sth->execute($biblionumber); -- 2.30.2