Bug 20060

Summary: Uninitialized warn from Koha::Template::Plugin::Branches
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: mtompset, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches

Description Marcel de Rooy 2018-01-22 12:03:50 UTC
Use of uninitialized value in string eq at /usr/share/koha/shadowclone/Koha/Template/Plugin/Branches.pm line 68.
Comment 1 Marcel de Rooy 2018-01-22 12:50:05 UTC
Created attachment 70793 [details] [review]
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches

The warn comes from undefined C4::Context->userenv->{branch}.
Can be triggered by calling mainpage.pl when being logged out in staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2018-01-22 13:03:37 UTC
To convince you. This is how userenv looks:

$VAR1 = {
          'branchprinter' => undef,
          'emailaddress' => undef,
          'branchname' => undef,
          'surname' => undef,
          'branch' => undef,
          'persona' => undef,
          'firstname' => undef,
          'cardnumber' => undef,
          'id' => '',
          'barshelves' => undef,
          'pubshelves' => undef,
          'shibboleth' => undef,
          'totshelves' => undef,
          'flags' => undef,
          'number' => undef
        };
Comment 3 Mark Tompsett 2018-01-30 23:32:29 UTC
Created attachment 71078 [details] [review]
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches

The warn comes from undefined C4::Context->userenv->{branch}.
Can be triggered by calling mainpage.pl when being logged out in staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Mark Tompsett 2018-01-30 23:33:46 UTC
I triggered this with just "localhost:8081" in the address bar in chrome. A url with mainpage did not trigger it for me.
Comment 5 Marcel de Rooy 2018-01-31 12:09:27 UTC
(In reply to M. Tompsett from comment #4)
> I triggered this with just "localhost:8081" in the address bar in chrome. A
> url with mainpage did not trigger it for me.

Thx for signing off. Mainpage triggered it while being logged out iirc.
Comment 6 Katrin Fischer 2018-02-04 11:21:57 UTC
Created attachment 71169 [details] [review]
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches

The warn comes from undefined C4::Context->userenv->{branch}.
Can be triggered by calling mainpage.pl when being logged out in staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2018-02-04 11:22:10 UTC
localhost:8081/cgi-bin/koha/mainpage.pl did it for me.
Comment 8 Jonathan Druart 2018-02-05 13:00:32 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 9 Nick Clemens (kidclamp) 2018-02-16 02:30:25 UTC
Awesome work all, pushed to stable for 17.11.03