From 5f901151e4b4d2c10b401cebac7413539c50736e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 15 Feb 2024 14:05:21 +0100 Subject: [PATCH] Bug 36098: Allow to pass storage_method Will need this on follow-up bugs. --- Koha/Session.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/Session.pm b/Koha/Session.pm index 68a7b2787a2..f3ac4c7b249 100644 --- a/Koha/Session.pm +++ b/Koha/Session.pm @@ -22,8 +22,8 @@ use C4::Context; use Koha::Caches; sub _get_session_params { - my $class = shift; - my $storage_method = C4::Context->preference('SessionStorage'); + my ( $class, $storage_method ) = @_; + $storage_method ||= C4::Context->preference('SessionStorage'); if ( $storage_method eq 'mysql' ) { my $dbh = C4::Context->dbh; return { dsn => "serializer:yamlxs;driver:MySQL;id:md5", dsn_args => { Handle => $dbh } }; @@ -47,7 +47,8 @@ sub _get_session_params { sub get_session { my ( $class, $args ) = @_; my $sessionID = $args->{sessionID}; - my $params = $class->_get_session_params(); + my $storage_method = $args->{storage_method}; + my $params = $class->_get_session_params( { storage_method => $storage_method } ); my $session; if ($sessionID) { # find existing CGI::Session::ErrorHandler->set_error(q{}); # clear error, cpan issue #111463 -- 2.34.1