Bug 35070: Fix get_enabled_plugins when database is not created yet
Koha::Plugins::get_enabled_plugins is called by Koha::Plugins::call which is called by C4::Templates->new, which is used in the web installer when the database is not created yet Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> (cherry picked from commit3df1cb33c2) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitfec97b4ae8) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
8860b00ae8
commit
a4edd5ca08
|
|
@ -116,9 +116,16 @@ sub get_enabled_plugins {
|
|||
my $enabled_plugins = Koha::Cache::Memory::Lite->get_from_cache(ENABLED_PLUGINS_CACHE_KEY);
|
||||
unless ($enabled_plugins) {
|
||||
$enabled_plugins = [];
|
||||
my $rs = Koha::Database->schema->resultset('PluginData');
|
||||
$rs = $rs->search({ plugin_key => '__ENABLED__', plugin_value => 1 });
|
||||
my @plugin_classes = $rs->get_column('plugin_class')->all();
|
||||
|
||||
my @plugin_classes;
|
||||
try {
|
||||
my $rs = Koha::Database->schema->resultset('PluginData');
|
||||
$rs = $rs->search({ plugin_key => '__ENABLED__', plugin_value => 1 });
|
||||
@plugin_classes = $rs->get_column('plugin_class')->all();
|
||||
} catch {
|
||||
warn "$_";
|
||||
};
|
||||
|
||||
foreach my $plugin_class (@plugin_classes) {
|
||||
unless (can_load(modules => { $plugin_class => undef }, nocache => 1)) {
|
||||
warn "Failed to load $plugin_class: $Module::Load::Conditional::ERROR";
|
||||
|
|
|
|||
Loading…
Reference in New Issue