From cbbf847fdeefe887fe12e71d61b2acbfb361a5a7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Apr 2022 15:05:24 +0200 Subject: [PATCH] Bug 30532: (bug 29957 follow-up) Fix '$cookie->value' We got Can't call method "value" on unblessed reference at /kohadevbox/koha/opac/opac-messaging.pl line 86 $cookie can be an arrayref, we should retrieve the session id using CGI->cookie('CGISESSID') Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- opac/opac-messaging.pl | 2 +- opac/opac-sendbasket.pl | 2 +- reports/guided_reports.pl | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 40643830c6..49d89e010e 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -83,7 +83,7 @@ if ( C4::Context->preference("SMSSendDriver") eq 'Email' ) { $template->param( sms_providers => \@providers, sms_provider_id => $patron->sms_provider_id ); } -my $new_session_id = $cookie->value; +my $new_session_id = $query->cookie('CGISESSID'); $template->param( csrf_token => Koha::Token->new->generate_csrf({ session_id => $new_session_id, diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index fdf8671ecb..25584aa894 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -182,7 +182,7 @@ END_OF_BODY output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } else { - my $new_session_id = $cookie->value; + my $new_session_id = $query->cookie('CGISESSID'); $template->param( bib_list => $bib_list, url => "/cgi-bin/koha/opac-sendbasket.pl", diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index a3479a3023..e8aba73344 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -77,7 +77,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( flagsrequired => { reports => $flagsrequired }, } ); -my $session = $cookie ? get_session($cookie->value) : undef; +my $session_id = $input->cookie('CGISESSID'); +my $session = $session_id ? get_session($session_id) : undef; my $filter; if ( $input->param("filter_set") or $input->param('clear_filters') ) { -- 2.39.5