[Koha-bugs] [Bug 24631] Plugin metadata should be outside the main class

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 29 19:21:34 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24631

--- Comment #34 from Kyle M Hall <kyle at bywatersolutions.com> ---
(In reply to Marcel de Rooy from comment #25)
> This part of GetPlugins is rather debatable:
>         load $plugin_class;
>         my $plugin = $plugin_class->new({
>             enable_plugins => $self->{'enable_plugins'}
>                 # loads even if plugins are disabled
>                 # FIXME: is this for testing without bothering to mock
> config?
>         });
> We should not execute it at all imo if we did not set enable_plugins. And
> the override flag enable_plugins here could well be a candidate for security
> problems.
> When we install a plugin, we could save the metadata that the interface
> needs into plugin_data ? Why read it every time? When we upgrade the plugin,
> we replace it.
> Why load every module on a plain GetPlugins call ?

I was thinking about this, and the problem is the plugin metadata may change at
any time. This is a more complicated problem than I had initially thought. We
could A) update the metadata ever time the plugin is loaded, or B) Update the
plugin metadata any time InstallPlugins is run. In any case this is outside the
scope of this bug and requires a bit of thought before I implement anything.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list