Bug 20068

Summary: Warn on OPAC homepage if not logged in due to OPAC dashboard
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: OPACAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 2093    
Bug Blocks:    
Attachments: Bug 20068: Check if user logged in before passing dashboard params to template
Bug 20068: Check if user logged in before passing dashboard params to template

Description Aleisha Amohia 2018-01-22 23:52:04 UTC
If accessing the OPAC homepage while not logged in, the following warn shows:
Use of uninitialized value $overdues_count in numeric gt (>) at /home/vagrant/kohaclone/opac/opac-main.pl line 76.
Comment 1 Aleisha Amohia 2018-01-22 23:54:14 UTC
Created attachment 70814 [details] [review]
Bug 20068: Check if user logged in before passing dashboard params to template

This prevents warns from dashboard variables when not logged in

To test:
1) Go to OPAC main homepage. Do not log in
2) Notice warn
3) Apply patch and refresh
4) Warn should be gone
5) Log in
6) Confirm dashboard shows as normal

Sponsored-by: Catalyst IT
Comment 2 Jonathan Druart 2018-01-23 12:34:41 UTC
Created attachment 70822 [details] [review]
Bug 20068: Check if user logged in before passing dashboard params to template

This prevents warns from dashboard variables when not logged in

To test:
1) Go to OPAC main homepage. Do not log in
2) Notice warn
3) Apply patch and refresh
4) Warn should be gone
5) Log in
6) Confirm dashboard shows as normal

Sponsored-by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2018-01-23 12:35:55 UTC
I have already written this change on bug 12001 and bug 19938 so I guess it is good to have it on its own bug report.
Comment 4 Jonathan Druart 2018-01-23 19:06:33 UTC
Skipping QA.
Comment 5 Jonathan Druart 2018-01-30 15:49:21 UTC
Pushed to master for 18.05
Comment 6 Nick Clemens 2018-02-02 17:02:27 UTC
Awesome work all! Pushed to stable for 17.11.03
Comment 7 Fridolin Somers 2018-02-08 09:47:59 UTC
Bug 2093 not in 17.05.x