From be571d1b50cbb5dd524c27e18898760c5ecdb73d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 8 May 2026 15:55:15 -0400 Subject: [PATCH] Bug 42571: Sending EDI order results in variable not available warnings The warnings look like: [2026/05/08 15:02:42] [32918] [WARN] Variable "@messages" is not available at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 698. [2026/05/08 15:02:42] [32918] [WARN] Variable "$op" is not available at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 704. Note in the fix, we are switching to the "our" keyword. When we declare things with "our", and we run this under plack, those variables and values persist across multiple requests! Due to this behavior we always need to reinitialize anything that uses "our" unless we specifically want that behavior ( like caching ). Test plan: 1) Send an EDI order, note the warnings in the logs 2) Apply this patch 3) Restart all the things! 4) Send another EDI order, note the warnings are gone! Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass --- acqui/basket.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 35c648c560..ac8d1ea9fd 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -235,12 +235,12 @@ unless ( CanUserManageBasket( $loggedinuser, $basket, $userflags ) ) { # FIXME : the query->param('booksellerid') below is probably useless. The bookseller is always known from the basket # if no booksellerid in parameter, get it from basket # warn "=>".$basket->{booksellerid}; -my $op = $query->param('op') // 'list'; +our $op = $query->param('op') // 'list'; our $confirm_pref = C4::Context->preference("BasketConfirmations") || '1'; $template->param( skip_confirm_reopen => 1 ) if $confirm_pref eq '2'; -my @messages; +our @messages = (); if ( $op eq 'cud-delete-order' ) { output_and_exit( $query, $cookie, $template, 'insufficient_permission' )