QuickSearch hat seine Konfiguration in gewissen Spalten in der
Datenbank. Um auf diese zugreifen zu können, müssen die dazugehörigen
Datenbankupgrades bereits eingespielt worden sein.
Da das Menü und damit die QuickSearch-Items auch während des Einspielens
der Upgrades angezeigt werden, kann es also dazu führen, dass die
Spalten noch nicht existieren. Daher wird QuickSearch nun komplett
deaktiviert, solange ausstehende Datenbankupgrades existieren.
sub pre_content {
my ($self) = @_;
+ my @options;
+ # Only enable the quick search functionality if all database
+ # upgrades have already been applied as quick search requires
+ # certain columns that are only created by said database upgrades.
+ push @options, (quick_search => SL::Controller::TopQuickSearch->new) unless $::request->applying_database_upgrades;
+
$self->presenter->render('menu/header',
now => DateTime->now_local,
is_fastcgi => $::dispatcher ? scalar($::dispatcher->interface_type =~ /fastcgi/i) : 0,
is_links => scalar($ENV{HTTP_USER_AGENT} =~ /links/i),
- quick_search => SL::Controller::TopQuickSearch->new,
+ @options,
);
}
use Rose::Object::MakeMethods::Generic
(
+ scalar => [ qw(applying_database_upgrades) ],
'scalar --get_set_init' => [ qw(cgi layout presenter is_ajax type) ],
);
return LOGIN_OK();
}
+ # Store the fact that we're applying database upgrades at the
+ # moment. That way functions called from the layout modules that may
+ # require updated tables can chose only to use basic features.
+ $::request->applying_database_upgrades(1);
+
$form->{$_} = $::auth->client->{$_} for qw(dbname dbhost dbport dbuser dbpasswd);
$form->{$_} = $myconfig{$_} for qw(datestyle);