Bug 10582

Summary: Koha OPAC URL shows Perl error message before web installer was run
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Installation and upgrade (web-based installer)Assignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: gmcharlt, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13169    
Bug Blocks:    
Attachments: Bug 10582: Koha OPAC URL shows Perl error message before web installer was run
[SIGNED OFF] Bug 10582: Koha OPAC URL shows Perl error message before web installer was run
[PASSED QA] Bug 10582: Koha OPAC URL shows Perl error message before web installer was run

Description Katrin Fischer 2013-07-12 09:03:27 UTC
When installing Koha and you open the URL to the OPAC before you have run the web installer there is a perl error message shown instead of the maintenance mode warning:

Cant's use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054.
Comment 1 Tomás Cohen Arazi 2014-10-31 16:12:02 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2014-11-01 09:06:03 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize 2014-11-06 11:35:21 UTC
Created attachment 33300 [details] [review]
[PASSED QA] Bug 10582: Koha OPAC URL shows Perl error message before web installer was run

This patch makes opac/maintenance.pl run smoothly when the DB hasn't
been populated yet. It does so, by using C4::Templates::gettemplate
instead of C4::Auth::get_user_and_template as the maintenance page doesn't
need authentication checks at all, it should happen *before* any attempt
to check credentials.

To test:
- Backup and DROP your database
- Point your browser to the OPAC page
=> FAIL: An error is shown: "Cant's use an undefined value as an ARRAY..."
- Apply the patch
- Relad the page
=> SUCCESS: The maintenance page correctly shows.
We should now check the rest of the script's behaviour remains untouched:
- Reload your backed up DB
- Change your DB version number by hand to one version lower, like in:
  > UPDATE systempreferences SET value="3.1700042" WHERE variable LIKE '%version%';
- Go to the OPAC
=> SUCCESS: Maintenance page shows as expected
- Recover the right  version number, like in:
  > UPDATE systempreferences SET value="3.1700043" WHERE variable LIKE '%version%';
- Set OpacMaintenance to Show on the staff client
- Reload the OPAC
=> SUCCESS: Maintenance page shows as expected
- Set OpacMaintenance to 'Don't show' on the staff client
- Reload the OPAC
=> SUCCESS: Normal OPAC shows
- Sign off :-D

Regards

Sponsored-by: Universidad Nacional de Cordoba

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, fixes long existing bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2014-11-06 11:48:50 UTC
Nice, I've been meaning to fix that for a few years now ;)

Passed QA
Comment 5 Tomás Cohen Arazi 2014-11-06 16:53:34 UTC
Patch pushed to master.