From 2ee5b5b1247b392a1dfbe695315db32f76775b0a 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: Fridolin Somers --- 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 84867da0ba..01faeb3cf4 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 d77a5b5b34..75ddd3dc2c 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -180,7 +180,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 a05314f908..c497dcc0a7 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