my $version;
# If Version syspref is unavailable, it means Koha is beeing installed,
# and so we must redirect to OPAC maintenance page or to the WebInstaller
- #warn "about to check version";
+ # also, if OpacMaintenance is ON, OPAC should redirect to maintenance
+ if (C4::Context->preference('OpacMaintenance') && $type eq 'opac') {
+ warn "OPAC Install required, redirecting to maintenance";
+ print $query->redirect("/cgi-bin/koha/maintenance.pl");
+ }
unless ($version = C4::Context->preference('Version')) { # assignment, not comparison
if ($type ne 'opac') {
warn "Install required, redirecting to Installer";