View | Details | Raw Unified | Return to bug 29826
Collapse All | Expand All

(-)a/Koha/Template/Plugin/Branches.pm (+2 lines)
Lines 30-35 use Koha::Libraries; Link Here
30
30
31
sub GetName {
31
sub GetName {
32
    my ( $self, $branchcode ) = @_;
32
    my ( $self, $branchcode ) = @_;
33
    return q{} unless defined $branchcode;
34
    return q{} if $branchcode eq q{};
33
35
34
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance;
36
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance;
35
    my $cache_key    = "Library_branchname:" . $branchcode;
37
    my $cache_key    = "Library_branchname:" . $branchcode;
(-)a/t/db_dependent/Template/Plugin/Branches.t (-2 / +4 lines)
Lines 38-44 my $builder = t::lib::TestBuilder->new; Link Here
38
38
39
subtest 'all() tests' => sub {
39
subtest 'all() tests' => sub {
40
40
41
    plan tests => 18;
41
    plan tests => 19;
42
42
43
    $schema->storage->txn_begin;
43
    $schema->storage->txn_begin;
44
44
Lines 68-73 subtest 'all() tests' => sub { Link Here
68
    $name = $plugin->GetName(undef);
68
    $name = $plugin->GetName(undef);
69
    is($name, '', 'received empty string as name of NULL/undefined library code');
69
    is($name, '', 'received empty string as name of NULL/undefined library code');
70
70
71
    $name = $plugin->GetName(q{});
72
    is($name, '', 'received empty string as name of empty string library code');
73
71
    is($plugin->GetLoggedInBranchcode(), '', 'no active library code if there is no active user session');
74
    is($plugin->GetLoggedInBranchcode(), '', 'no active library code if there is no active user session');
72
    is($plugin->GetLoggedInBranchname(), '', 'no active library name if there is no active user session');
75
    is($plugin->GetLoggedInBranchname(), '', 'no active library name if there is no active user session');
73
76
74
- 

Return to bug 29826