Bug 31785: (follow-up) Fix modify operation too
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 14 Oct 2022 09:07:14 +0000 (09:07 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 14 Oct 2022 18:47:57 +0000 (15:47 -0300)
Test plan:
Enable SQL strict mode (koha-conf).
Modify branch, set Public to No.
Check.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
admin/branches.pl

index 0b3a12f..112ca42 100755 (executable)
@@ -87,7 +87,7 @@ if ( $op eq 'add_form' ) {
     if ($is_a_modif) {
         my $library = Koha::Libraries->find($branchcode);
         for my $field (@fields) {
-            if ( $field eq 'pickup_location' ) {
+            if( $field =~ /^(pickup_location|public)$/  ) {
                 # Don't fallback to undef/NULL, default is 1 in DB
                 $library->$field( scalar $input->param($field) );
             } else {