Bug 10363: [QA Followup]

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle M Hall 2014-11-24 07:48:02 -05:00 committed by Tomas Cohen Arazi
parent 64aa24d593
commit 9b029fbc45
2 changed files with 6 additions and 4 deletions

View File

@ -63,7 +63,7 @@ sub search {
->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 {

View File

@ -101,7 +101,7 @@ if ($op eq 'add_form') {
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 );
@ -113,7 +113,7 @@ if ($op eq 'add_form') {
$av->imageurl( $imageurl );
eval{
$av->store;
$av->branch_limitations( \@branches );
$av->replace_branch_limitations( \@branches );
};
if ( $@ ) {
push @messages, {type => 'error', code => 'error_on_update' };
@ -129,10 +129,12 @@ if ($op eq 'add_form') {
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 {