Bug 8737

Summary: Incorrect icon at login in staff client
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: TemplatesAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P5 - low CC: chris, kyle, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Sets missing environment variable so correct icon is displayed.
Bug 8737 - Incorrect icon at login in staff client

Description Mark Tompsett 2012-09-07 05:32:46 UTC
Problem: despite setting the syspref for IntranetFavicon and doing several refreshes, the default koha icon shows in my firefox tab.

Test:
1) Go to koha staff client to log in. The default green box k logo should be in the browsers tab.
2) Log in.
3) If it is still the default:
3-1) click "Koha Administration"
3-2) click "Global system preferences"
3-3) click on the "Staff client" tab near the bottom left of the page
3-4) In the "Appearance" section, modified the "IntranetFavicon" system preference to point a different icon.
3-5) scroll down and click 'Save all staff client preferences'
3-6) log out
3-7) log in
4) It should now be a different icon.
5) log out. It should now be the default icon, not the same one as logged in.

Before coming upon what I am going to attach as a solution, I was looking in Template. jcamins commented out a section of code that I was going to add to as a solution, so I figured that wouldn't be a good solution. I then checked to see if it worked for OPAC. It did, so something must have the right code for Opac, but have forgotten the Intranet.

Pre-solution hunt:
1) cd kohaclone
2) grep OpacFavicon `find . -name "*.p[lm]"`
3) grep IntranetFavicon `find . -name "*.p[lm]"`
4) Note there are two entries for OpacFavicon in C4/Auth.pm, but only one IntranetFavicon entry

So looking at around line 949 which is in the "AUTH rejected" section, I found both OPAC and Intranet variables were being set, but the IntranetFavicon was missing.

NOTE: Someone more familiar with expected environment variables should check if anything else is missing.
Comment 1 Mark Tompsett 2012-09-07 06:00:37 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-09-07 13:33:15 UTC
Created attachment 12046 [details] [review]
Bug 8737 - Incorrect icon at login in staff client

Added the following missing code to ensure the correct icon
is used when logged out:
   IntranetFavicon => C4::Context->preference('IntranetFavicon')
This was added into an existing $template->param() call.

Not to be confused with the koha logo on the login page, the
icon is a 16x16 pixel graphic in the browser tab. The default
is found at .../intranet-tmpl/prog/en/includes/favicon.ico.

If the "IntranetFavicon" system preference is set, it should be
used by the staff client regardless of login state. It was not
being used in the "AUTH rejected" section of Auth.pm, but the
OpacFavicon variable was being set. This explains why the
"OpacFavicon" system preference works for the OPAC client, but
not the staff client upon logout.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 3 Paul Poulain 2012-10-03 09:07:57 UTC
QA comment: trivial patch
Comment 4 Paul Poulain 2012-10-03 09:09:24 UTC
More a minor bugfix than an ENH. Patch pushed to master
Comment 5 Chris Cormack 2013-04-20 23:14:29 UTC
Pushed to 3.8.x will be in 3.8.12 (was released with 3.10.0)