-% if ( $count == 0 ) {
+% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) {
- <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'classnum' %>" VALUE="">
+ <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'classnum' %>" VALUE="">
% } else {
my %opt = @_;
my $classnum = $opt{'curr_value'} || $opt{'value'};
-my $count = scalar( qsearch( 'pkg_class', {} ) );
+$opt{'pkg_class'} ||= [ qsearch( 'pkg_class', { disabled=>'' } ) ];
</%init>