Lines 87-93
if ( $op eq 'add_form' ) {
Link Here
|
87 |
if ($is_a_modif) { |
87 |
if ($is_a_modif) { |
88 |
my $library = Koha::Libraries->find($branchcode); |
88 |
my $library = Koha::Libraries->find($branchcode); |
89 |
for my $field (@fields) { |
89 |
for my $field (@fields) { |
90 |
$library->$field( $input->param($field) ); |
90 |
$library->$field( scalar $input->param($field) ); |
91 |
} |
91 |
} |
92 |
$library->update_categories( \@categories ); |
92 |
$library->update_categories( \@categories ); |
93 |
|
93 |
|
Lines 168-176
if ( $op eq 'add_form' ) {
Link Here
|
168 |
if ($is_a_modif) { |
168 |
if ($is_a_modif) { |
169 |
my $category = Koha::LibraryCategories->find($categorycode); |
169 |
my $category = Koha::LibraryCategories->find($categorycode); |
170 |
for my $field (@fields) { |
170 |
for my $field (@fields) { |
171 |
$category->$field( $input->param($field) ); |
171 |
$category->$field( scalar $input->param($field) ); |
172 |
} |
172 |
} |
173 |
$category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' ); |
173 |
$category->show_in_pulldown( scalar $input->param('show_in_pulldown') eq 'on' ); |
174 |
eval { $category->store; }; |
174 |
eval { $category->store; }; |
175 |
if ($@) { |
175 |
if ($@) { |
176 |
push @messages, { type => 'alert', code => 'error_on_update_category' }; |
176 |
push @messages, { type => 'alert', code => 'error_on_update_category' }; |
Lines 183-189
if ( $op eq 'add_form' ) {
Link Here
|
183 |
( map { $_ => scalar $input->param($_) || undef } @fields ) |
183 |
( map { $_ => scalar $input->param($_) || undef } @fields ) |
184 |
} |
184 |
} |
185 |
); |
185 |
); |
186 |
$category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' ); |
186 |
$category->show_in_pulldown( scalar $input->param('show_in_pulldown') eq 'on' ); |
187 |
eval { $category->store; }; |
187 |
eval { $category->store; }; |
188 |
if ($@) { |
188 |
if ($@) { |
189 |
push @messages, { type => 'alert', code => 'error_on_insert_category' }; |
189 |
push @messages, { type => 'alert', code => 'error_on_insert_category' }; |