Bug 37865: Fix uninitialized value $op warns

[WARN] Use of uninitialized value $op in string eq at /usr/share/koha/intranet/cgi-bin/circ/circulation.pl line 144.
[WARN] Use of uninitialized value $op in string eq at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 253.
These happen in cases when $op is undef and circulation.pl or returns.pl tries to directly compare it to a string.

To reproduce:
1. Go to "Check Out" and "Check In" circulation pages, or refresh already opened one.
2. Check your logs for "Use of uninitialized value $op" warning.
3. Apply patch.
4. Repeat step 1 and check that no new "Use of uninitialized value $op" error were logged.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e2b493d67)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Andrii Nugged 2024-07-29 16:13:34 +03:00 committed by Lucas Gass
parent 4a460068a8
commit fbdb96e293
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
}
);
my $op = $query->param('op');
my $op = $query->param('op') // '';
my $override_high_holds = $query->param('override_high_holds');
my $override_high_holds_tmp = $query->param('override_high_holds_tmp');

View File

@ -143,7 +143,7 @@ foreach ( $query->param ) {
push( @inputloop, \%input );
}
my $op = $query->param('op');
my $op = $query->param('op') // '';
############
# Deal with the requests....