The problem was particularly visible in search facets, but existed
before: the cache key used for fielder results did not take locale into
account, so on a multi-locale system the first locale won and populated
the cache for all other locales.
Use a session locale if provided, otherwise default to the locale set in
opensrf.xml
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
my $cache;
my $cache_timeout;
+my $default_locale;
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
$cache_timeout = $conf->config_value(
"apps", "open-ils.fielder", "app_settings", "cache_timeout" ) || 300;
+ $default_locale = $conf->config_value("default", "default_locale") || 'en-US';
+
generate_methods();
}
my $client = shift;
my $obj = shift;
+ my $locale = $self->session->session_locale || $default_locale;
my $query = $obj->{query};
my $nocache = $obj->{cache} ? 0 : 1;
my $fields = $obj->{fields};
$qstring .
$fstring .
$distinct .
- $obj_class
+ $obj_class .
+ $locale
);
$res = $cache->get_cache( $key );