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.
Created attachment 33089 [details] [review] 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
Created attachment 33117 [details] [review] [SIGNED OFF] 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.
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>
Nice, I've been meaning to fix that for a few years now ;) Passed QA
Patch pushed to master.