From f8f26772161560d7cfa252d67dd550fc658e655b Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 6 Nov 2023 09:39:52 +0000 Subject: [PATCH] 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 Signed-off-by: David Nind --- admin/categories.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/categories.pl b/admin/categories.pl index 365bfb98f5..1485e5b60f 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -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'); -- 2.30.2