When on an error page (ie 404.pl), clicking the Help link triggers a warn in the error log: help.pl: Use of uninitialized value $lang in concatenation (.) or string at /home/vagrant/kohaclone/help.pl line 52.
Created attachment 41107 [details] [review] Bug 14580: Silencing warn triggered when accessing Help from an error page To test: 1) Go to an error page (ie cgi-bin/koha/errors/404.pl or just going to an invalid link will do it) 2) Click 'Help' 3) Notice warn 4) Apply patch and refresh page 5) Click 'Help' 6) Notice warn is gone and help still loads as it should
Patch applies correctly, warn silenced as expected. Signed off.
The problem is with C4::Templates::themelanguage function, it doesn't return anything in this situation. Should we fix that function instead, because bug 14681 has the same problem and I'm thinking other pages might have it too. I tried to look into a fix to that function but didn't come up with any clever fix. One idea was to default to some default themes/language but then we cannot know if they're installed or not.
We would like a global solution here. themelanguage should be fixed not to return undef.
*** Bug 14681 has been marked as a duplicate of this bug. ***
Correction: This is triggered when there is no available Help for that page. You can test with Tools -> Rotating Collections too as this currently has no Help (Bug 13177)
I'm going to add on to this bug - When you click 'Add help' to create a help page where there isn't one, it doesn't open and gives this error: edithelp.pl: print() on closed filehandle $fh at /home/vagrant/kohaclone/edithelp.pl line 82 which means the file open is failing
Looks like this has been fixed in master by redirecting to the manual.