The issue was that the index for itemtype is different depending
on whether you're using item-level or bib-level itemtypes. This
patch detects the system choice and sets the index properly
# load the Type stuff
# load the Type stuff
my $itemtypes = GetItemTypes;
+# the index parameter is different for item-level itemtypes
+my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
my @itemtypesloop;
my $selected=1;
my $cnt;
if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
my %row =( number=>$cnt++,
imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
- ccl => 'itemtype',
+ ccl => $itype_or_itemtype,
code => $thisitemtype,
selected => $selected,
description => $itemtypes->{$thisitemtype}->{'description'},
# load the Type stuff
my $itemtypes = GetItemTypes;
+# the index parameter is different for item-level itemtypes
+my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
my @itemtypesloop;
my $selected=1;
my $cnt;
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
my %row =( number=>$cnt++,
imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
- ccl => 'itemtype',
+ ccl => $itype_or_itemtype,
code => $thisitemtype,
selected => $selected,
description => $itemtypes->{$thisitemtype}->{'description'},