Lines 102-108
if ($op eq 'add_form') {
Link Here
|
102 |
my $duplicate_entry = 0; |
102 |
my $duplicate_entry = 0; |
103 |
my @branches = grep { $_ ne q{} } $input->param('branches'); |
103 |
my @branches = grep { $_ ne q{} } $input->param('branches'); |
104 |
|
104 |
|
105 |
if ( $id ) { # Update |
105 |
my $already_exists = Koha::AuthorisedValues->search( |
|
|
106 |
{ |
107 |
category => $new_category, |
108 |
authorised_value => $new_authorised_value, |
109 |
} |
110 |
)->count; |
111 |
|
112 |
if ( $already_exists ) { |
113 |
push @messages, {type => 'error', code => 'already_exists' }; |
114 |
} |
115 |
elsif ( $id ) { # Update |
106 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
116 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
107 |
|
117 |
|
108 |
$av->lib( $input->param('lib') || undef ); |
118 |
$av->lib( $input->param('lib') || undef ); |