Bug 10582: Koha OPAC URL shows Perl error message before web installer was run
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 31 Oct 2014 15:50:37 +0000 (12:50 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 6 Nov 2014 16:51:37 +0000 (13:51 -0300)
commit5a82616ab7fcaee9764d340756c6a2afe851658f
tree92b24f8a7c8f574cc056d1bea6610ab0e9d27ed6
parentbba3306d45aba8626c3ef460de06a4e76abafaf9
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
opac/maintenance.pl