Skip to content
Permalink
Browse files
Fixes bugs with #144.
  • Loading branch information
drn05r committed Sep 10, 2021
1 parent ce2909c commit 41f6f199d7abb753a3d180aabde6a0c482825ff8
Showing with 20 additions and 2 deletions.
  1. +20 −2 perl_lib/EPrints/MetaField/Subject.pm
@@ -125,13 +125,31 @@ sub render_set_input
$self->{showtop},
0,
($self->{input_style} eq "short"?1:0) );
foreach my $value ( @{$obj->get_value( $self->{name} )} )
my ( $depospairs ) = $topsubj->get_subjects(
1,
$self->{showtop},
0,
($self->{input_style} eq "short"?1:0) );

my $values = $obj->get_value( $self->{name} );
$values ||= [];
$values = [ $values ] unless ref $values eq 'ARRAY';
foreach my $value ( @{$values} )
{
foreach my $pair ( @{$allpairs} )
{
if ( $pair->[0] eq $value )
{
unshift @{$pairs}, $pair;
my $depositable = 0;
foreach my $dpair ( @{$depospairs} )
{
if ( $dpair->[0] eq $value )
{
$depositable = 1;
last;
}
}
unshift @{$pairs}, $pair unless $depositable;
last;
}
}

0 comments on commit 41f6f19

Please sign in to comment.