Bug 35263: Default 'can_place_ill_in_opac' to 1

If ILLModule sys pref is 'off', this input param is undef. The database does not allow it to be nullable causing an error.
Check if its defined (i.e. the option was submitted) and use that, if not default to 1

Test plan, k-t-d:
1) Edit an existing patron category, visit:
/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=B
2) Click 'Save' at the bottom of the form
3) Notice a yellow box is shown with an error message
4) Apply patch. Repeat steps 1-3. Notice it now updates successfully.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-11-06 09:39:52 +00:00 committed by Tomas Cohen Arazi
parent 93f75b39ac
commit bac896bb65
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ elsif ( $op eq 'add_validate' ) {
my $category_type = $input->param('category_type');
my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
my $checkPrevCheckout = $input->param('checkprevcheckout');
my $can_place_ill_in_opac = $input->param('can_place_ill_in_opac');
my $can_place_ill_in_opac = defined $input->param('can_place_ill_in_opac') ? $input->param('can_place_ill_in_opac') : 1;
my $default_privacy = $input->param('default_privacy');
my $reset_password = $input->param('reset_password');
my $change_password = $input->param('change_password');