Bugzilla – Attachment 156741 Details for
Bug 35011
Allow system administrators control over whether plugins can be uninstalled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35011: Record interface used to install a plugin
Bug-35011-Record-interface-used-to-install-a-plugi.patch (text/plain), 1.37 KB, created by
Martin Renvoize (ashimema)
on 2023-10-09 12:05:52 UTC
(
hide
)
Description:
Bug 35011: Record interface used to install a plugin
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-09 12:05:52 UTC
Size:
1.37 KB
patch
obsolete
>From 92b2956d39a21badde1bd042221a954b8c972b88 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 9 Oct 2023 13:04:07 +0100 >Subject: [PATCH] Bug 35011: Record interface used to install a plugin > >This patch adds a record of the interface used when installing a plugin >for the first time. We utilise the existing plugin_data table and add a >new __INSTALLED_VIA__ system key to store the data. >--- > Koha/Plugins.pm | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index a3c47006b55..d328a2e67e2 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -270,6 +270,26 @@ sub InstallPlugins { > > Koha::Cache::Memory::Lite->clear_from_cache(ENABLED_PLUGINS_CACHE_KEY); > >+ my $rs = Koha::Database->schema->resultset('PluginData'); >+ for my $plugin (@plugins) { >+ my $exists = $rs->search( >+ { >+ plugin_key => '__INSTALLED_VIA__', >+ plugin_class => $plugin->plugin_class >+ } >+ ); >+ unless ( $exists->count == 1 ) { >+ $rs->create( >+ { >+ plugin_key => '__INSTALLED_VIA__', >+ plugin_class => $plugin->plugin_class, >+ plugin_value => C4::Context->interface, >+ } >+ ); >+ >+ } >+ } >+ > return @plugins; > } > >-- >2.41.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35011
: 156741