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>
This commit is contained in:
Marcel de Rooy 2022-10-14 07:42:26 +00:00 committed by Lucas Gass
parent eb1083beb2
commit 83f20319c3

View file

@ -124,7 +124,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