From b3a2e405a4ff7330771b7bc81f724e2992e0d904 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Mon, 25 Jan 2021 17:37:37 +0200 Subject: [PATCH] Bug 27549: "use of uninitialized value" warning on renew.pl On the beginning we have empty "barcode" parameter for this form, but that not taken into account in regular expression warning emitted: "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47." in renew.pl Fixed by making $barcode to become an empty string by default. To reproduce: 1) Head over to the "Circulation -> Renew" page. 2) Check intranet-error.log there will be a warning "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47". 3) Apply the patch, refresh the "Renew" page. 4) Ensure that the new "use of uninitialized value" warnings didn't appear in the console. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 1af07787032275813e1e458cfed8504b482cd1c6) Signed-off-by: Fridolin Somers (cherry picked from commit fa472369c034cbcda80f6025ab3fbdbed58bda7c) Signed-off-by: Andrew Fuerste-Henry --- circ/renew.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circ/renew.pl b/circ/renew.pl index 06495778c4..07df6a1577 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -42,7 +42,7 @@ my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( my $schema = Koha::Database->new()->schema(); -my $barcode = $cgi->param('barcode'); +my $barcode = $cgi->param('barcode') // ''; $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); my $override_limit = $cgi->param('override_limit'); -- 2.39.5