Bugzilla – Attachment 107156 Details for
Bug 25765
Replace LoginBranchname and LoginBranchcode with use of Branches template plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25765: (QA follow-up) Save a DB hit
Bug-25765-QA-follow-up-Save-a-DB-hit.patch (text/plain), 1.79 KB, created by
Martin Renvoize (ashimema)
on 2020-07-21 15:12:47 UTC
(
hide
)
Description:
Bug 25765: (QA follow-up) Save a DB hit
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-07-21 15:12:47 UTC
Size:
1.79 KB
patch
obsolete
>From 7b9209fbeda2047521aed9fc6e6810cb19c3e6ba Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 21 Jul 2020 15:58:02 +0100 >Subject: [PATCH] Bug 25765: (QA follow-up) Save a DB hit > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Template/Plugin/Branches.pm | 3 +-- > t/db_dependent/Template/Plugin/Branches.t | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 51a2df93a3..05932dac68 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -43,8 +43,7 @@ sub GetLoggedInBranchcode { > sub GetLoggedInBranchname { > my ($self) = @_; > >- my $code = $self->GetLoggedInBranchcode; >- return $code ? $self->GetName($code) : q{}; >+ return C4::Context->userenv ? C4::Context->userenv->{'branchname'} : q{}; > } > > sub GetURL { >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index 17a41b7fe6..f6141d9345 100644 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -71,7 +71,7 @@ subtest 'all() tests' => sub { > is($plugin->GetLoggedInBranchcode(), '', 'no active library code if there is no active user session'); > is($plugin->GetLoggedInBranchname(), '', 'no active library name if there is no active user session'); > >- t::lib::Mocks::mock_userenv({ branchcode => 'MYLIBRARY' }); >+ t::lib::Mocks::mock_userenv({ branchcode => 'MYLIBRARY', branchname => 'My sweet library' }); > is($plugin->GetLoggedInBranchcode(), 'MYLIBRARY', 'GetLoggedInBranchcode() returns active library code'); > is($plugin->GetLoggedInBranchname(), 'My sweet library', 'GetLoggedInBranchname() returns active library name'); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25765
:
105909
|
105910
|
106357
|
106358
|
107154
|
107155
| 107156 |
107157