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 <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit be571d1b50)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
parent
6b3773bae3
commit
30880dbcf4
|
|
@ -236,12 +236,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' )
|
||||
|
|
|
|||
Loading…
Reference in New Issue