session management: use YAML::Syck for serialization
When using mysql and a sufficiently recent version of DBD::mysql that actually respects the mysql_enable_utf8 option, setting the current branch to a name that includes a diacritic causes the session to fail and forces the user to the login screen upon clicking another link. This turned out to be due to the default (Data::Dumper) serialization used by CGI::Session, which truncated the session object at the diacritic. By enabling that module's YAML serialization option, the problem was resolved. This patch introduces a dependency on the YAML::Syck module. Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
88451107ae
commit
a858e8a8b8
|
|
@ -1083,14 +1083,14 @@ sub get_session {
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $session;
|
||||
if ($storage_method eq 'mysql'){
|
||||
$session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh});
|
||||
$session = new CGI::Session("driver:MySQL;serializer:yaml", $sessionID, {Handle=>$dbh});
|
||||
}
|
||||
elsif ($storage_method eq 'Pg') {
|
||||
$session = new CGI::Session("driver:PostgreSQL", $sessionID, {Handle=>$dbh});
|
||||
$session = new CGI::Session("driver:PostgreSQL;serializer:yaml", $sessionID, {Handle=>$dbh});
|
||||
}
|
||||
else {
|
||||
# catch all defaults to tmp should work on all systems
|
||||
$session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'});
|
||||
$session = new CGI::Session("driver:File;serializer:yaml", $sessionID, {Directory=>'/tmp'});
|
||||
}
|
||||
return $session;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,6 +520,7 @@ WriteMakefile(
|
|||
'XML::SAX::ParserFactory' => 1.01,
|
||||
'XML::Simple' => 2.14,
|
||||
'XML::RSS' => 1.31,
|
||||
'YAML::Syck' => 1.00,
|
||||
},
|
||||
|
||||
# File tree mapping
|
||||
|
|
|
|||
1
about.pl
1
about.pl
|
|
@ -112,6 +112,7 @@ XML::LibXSLT
|
|||
XML::SAX::ParserFactory
|
||||
XML::Simple
|
||||
XML::RSS
|
||||
YAML::Syck
|
||||
/;
|
||||
|
||||
my @components = ();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ libxml2-dev install
|
|||
libxml2-utils install
|
||||
libxslt1-dev install
|
||||
libxslt1.1 install
|
||||
libyaml-syck-perl install
|
||||
libyaz install
|
||||
libyaz-dev install
|
||||
yaz install
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ if ( $step && $step == 1 ) {
|
|||
unless ( eval { require ZOOM } ) {
|
||||
push @missing, { name => "ZOOM" };
|
||||
}
|
||||
unless ( eval { require YAML::Syck } ) {
|
||||
push @missing, { name => "YAML::Syck" };
|
||||
}
|
||||
unless ( eval { require LWP::Simple } ) {
|
||||
push @missing, { name => "LWP::Simple" };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue