Bug 36098: Default to 'file' if pref does not exist

During the installer process there is a bunch of warnings
  "Use of uninitialized value $storage_method in string eq at"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e2440f2c61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a42bce58b2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 922928eb7d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Jonathan Druart 2024-02-21 09:42:16 +01:00 committed by Frédéric Demians
parent 8b1c2a823f
commit 35fcb2a798

View file

@ -53,7 +53,7 @@ will be created.
sub _get_session_params {
my ( $class, $args ) = @_;
my $storage_method = $args->{storage_method};
$storage_method ||= C4::Context->preference('SessionStorage');
$storage_method ||= C4::Context->preference('SessionStorage') || 'file';
if ( $storage_method eq 'mysql' ) {
my $dbh = C4::Context->dbh;
return { dsn => "serializer:yamlxs;driver:MySQL;id:md5", dsn_args => { Handle => $dbh } };