->search( { %$params, %$or, }, $join );
my $class = ref($self);
- return wantarray ? $self->_wrap( $rs->all() ) : $class->new_from_dbic($rs);
+ return wantarray ? $self->_wrap( $rs->all() ) : $class->_new_from_dbic($rs);
}
sub categories {
my $imageurl = $input->param( 'imageurl' ) || '';
$imageurl = '' if $imageurl =~ /removeImage/;
my $duplicate_entry = 0;
- my @branches = $input->param('branches');
+ my @branches = grep { $_ ne q{} } $input->param('branches');
if ( $id ) { # Update
my $av = Koha::AuthorisedValues->new->find( $id );
$av->imageurl( $imageurl );
eval{
$av->store;
- $av->branch_limitations( \@branches );
+ $av->replace_branch_limitations( \@branches );
};
if ( $@ ) {
push @messages, {type => 'error', code => 'error_on_update' };
lib_opac => $input->param('lib_opac') || undef,
imageurl => $imageurl,
} );
+
eval {
$av->store;
- $av->branch_limitations( \@branches );
+ $av->replace_branch_limitations( \@branches );
};
+
if ( $@ ) {
push @messages, {type => 'error', code => 'error_on_insert' };
} else {