Bug 31785: Fix for adding non-public library

The code in admin/branches.pl changed a 0 to undef which is not
desirable for booleans.
A similar fix was already present for pickup_location.
This may need a bit more thought (somewhere else!).

Test plan:
Add a new branch with pickup location No, public 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>
(cherry picked from commit 9c4a557c97)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 83f20319c3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Marcel de Rooy 2022-10-14 07:42:26 +00:00 committed by Arthur Suzuki
parent 6d374b99c4
commit 1af547fcfb
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ if ( $op eq 'add_form' ) {
branchcode => $branchcode,
(
map {
$_ eq 'pickup_location' # Don't fallback to undef/NULL, default is 1 in DB
/^(pickup_location|public)$/ # Don't fallback to undef for those fields
? ( $_ => scalar $input->param($_) )
: ( $_ => scalar $input->param($_) || undef )
} @fields