Bug 20060 - Uninitialized warn from Koha::Template::Plugin::Branches
Summary: Uninitialized warn from Koha::Template::Plugin::Branches
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 12:03 UTC by Marcel de Rooy
Modified: 2018-06-04 20:15 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches (1.19 KB, patch)
2018-01-22 12:50 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches (1.20 KB, patch)
2018-01-30 23:32 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 20060: Resolve uninitialized warn from Koha::Template::Plugin::Branches (1.26 KB, patch)
2018-02-04 11:21 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 M. 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 M. 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 2018-02-16 02:30:25 UTC
Awesome work all, pushed to stable for 17.11.03