Lines 512-530
sub preference {
Link Here
|
512 |
|
512 |
|
513 |
$var = lc $var; |
513 |
$var = lc $var; |
514 |
|
514 |
|
|
|
515 |
return $ENV{"OVERRIDE_SYSPREF_$var"} |
516 |
if defined $ENV{"OVERRIDE_SYSPREF_$var"}; |
517 |
|
518 |
my $value; |
515 |
my $cached_var = $use_syspref_cache |
519 |
my $cached_var = $use_syspref_cache |
516 |
? $syspref_cache->get_from_cache("syspref_$var") |
520 |
? $syspref_cache->get_from_cache("syspref_$var") |
517 |
: undef; |
521 |
: undef; |
518 |
return $cached_var if defined $cached_var; |
522 |
return $cached_var if defined $cached_var; |
519 |
|
523 |
|
520 |
my $value; |
524 |
my $syspref; |
521 |
if ( defined $ENV{"OVERRIDE_SYSPREF_$var"} ) { |
525 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
522 |
$value = $ENV{"OVERRIDE_SYSPREF_$var"}; |
526 |
my $value = $syspref ? $syspref->value() : undef; |
523 |
} else { |
|
|
524 |
my $syspref; |
525 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
526 |
$value = $syspref ? $syspref->value() : undef; |
527 |
} |
528 |
|
527 |
|
529 |
if ( $use_syspref_cache ) { |
528 |
if ( $use_syspref_cache ) { |
530 |
$syspref_cache->set_in_cache("syspref_$var", $value); |
529 |
$syspref_cache->set_in_cache("syspref_$var", $value); |
531 |
- |
|
|