Bug 10582 - Koha OPAC URL shows Perl error message before web installer was run
Summary: Koha OPAC URL shows Perl error message before web installer was run
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact:
URL:
Keywords:
Depends on: 13169
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-12 09:03 UTC by Katrin Fischer
Modified: 2015-06-04 23:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10582: Koha OPAC URL shows Perl error message before web installer was run (3.42 KB, patch)
2014-10-31 16:12 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[SIGNED OFF] Bug 10582: Koha OPAC URL shows Perl error message before web installer was run (3.54 KB, patch)
2014-11-01 09:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 10582: Koha OPAC URL shows Perl error message before web installer was run (3.61 KB, patch)
2014-11-06 11:35 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.