Today we can only disable all or none plugin by dealing with koha configuration. It would be interesting to be able to temporarily, or not, disable one or more without having to remove them from plugins directory. This could be useful for plugins called by hook like "intranet_catalog_biblio_enhancements_toolbar_button" or checkpw (see bug 20340). Disabling is not like uninstalling. Because here we want to keep the data and db structure created by the plugin in the case it would be enabled again. Also, uninstalled plugin are retrieved by GetPlugins method like installed ones. Work in progress...
Created attachment 83537 [details] [review] Bug 22053: create unit tests
Created attachment 83538 [details] [review] Bug 22053: ability to enable/disable some plugins Test plan: - apply this patch(es), - launch an updatedabase, - go to plugins/plugins-home.pl and deal with enable/disable method - install a plugin like KitchenSink https://github.com/bywatersolutions/koha-plugin-kitchen-sink - once installed, the plugin change the background color of the staff client to orange. - disable the plugin, - background color should be set back to the original one
Created attachment 83539 [details] [review] Bug 22053: update database
Created attachment 83540 [details] [review] [DO NOT PUSH] Bug 22053: provide staff-global.css
*** Bug 21558 has been marked as a duplicate of this bug. ***
Please always check for existing bugs first ;)
(In reply to Katrin Fischer from comment #6) > Please always check for existing bugs first ;) I checked! But surely the wrong way >_< There is no patch on the first one. So what do i do ? Closing this one and submit my patches on bug 21558 or i keep my patches there ?
I marked the other as a duplicate of this one - bug with patches always wins :)
Created attachment 83666 [details] Bug 10676: Fix behaviour of OpacHiddenItems for items.restricted The numerical restricted value was overwritten in GetItemsInfo with the description. So OpacHiddenItems would only work for restricted using the description, not the numerical value of the authorised value like for other similar status fields. This changes GetItemsInfo to use a separate variable for the description, as it's already done for notforloan and changes the template files where the variable is used accordingly. To test - Before applying patch - Configure OpacHiddenItems with: restricted: [1] - Find a record with more than one item and mark one of the items as "Restricted Access" (assume standard sample data - check authorised value if status doesn't exist) - Verify the item is still shown in OPAC. - Apply patch - Verify that the item is now hidden - Verify that the status still displays nicely in the staff detail page - Delete OpacHiddenItems - Verify that the status is showing nicely in the OPAC detail page Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Created attachment 83667 [details] Bug 10676: Add unit tests - GetItemsInfo To test: prove t/db_dependent/Items.t Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Created attachment 86961 [details] [review] Bug 22053: create unit tests Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 86962 [details] [review] Bug 22053: ability to enable/disable some plugins Test plan: - apply this patch(es), - launch an updatedabase, - go to plugins/plugins-home.pl and deal with enable/disable method - install a plugin like KitchenSink https://github.com/bywatersolutions/koha-plugin-kitchen-sink - once installed, the plugin change the background color of the staff client to orange. - disable the plugin, - background color should be set back to the original one Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 86963 [details] [review] Bug 22053: update database Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 86964 [details] [review] [DO NOT PUSH] Bug 22053: provide staff-global.css Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 88783 [details] [review] [SIGNED-OFF] Bug 22053: create unit tests Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 88784 [details] [review] [SIGNED-OFF] Bug 22053: ability to enable/disable some plugins Test plan: - apply this patch(es), - launch an updatedabase, - go to plugins/plugins-home.pl and deal with enable/disable method - install a plugin like KitchenSink https://github.com/bywatersolutions/koha-plugin-kitchen-sink - once installed, the plugin change the background color of the staff client to orange. - disable the plugin, - background color should be set back to the original one Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 88785 [details] [review] [SIGNED-OFF] Bug 22053: update database Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 88818 [details] [review] Bug 22053: create unit tests Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Created attachment 88819 [details] [review] Bug 22053: ability to enable/disable some plugins Test plan: - apply this patch(es), - launch an updatedabase, - go to plugins/plugins-home.pl and deal with enable/disable method - install a plugin like KitchenSink https://github.com/bywatersolutions/koha-plugin-kitchen-sink - once installed, the plugin change the background color of the staff client to orange. - disable the plugin, - background color should be set back to the original one Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Created attachment 88820 [details] [review] Bug 22053: update database Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Hello Alex, awesome job!, it works great.. Just a little question.. I noticed that disabled plugins have the "run plugin" button enabled, and when you click on it works.. shouldn't that button be disabled if you disable the entire plugin?.. or this bug is intended only for hookup functions?
(In reply to Agustín Moyano from comment #21) > Hello Alex, awesome job!, it works great.. > > Just a little question.. > > I noticed that disabled plugins have the "run plugin" button enabled, and > when you click on it works.. > > shouldn't that button be disabled if you disable the entire plugin?.. or > this bug is intended only for hookup functions? s/"run plugin" button/"run tool" option/g :P
(In reply to Agustín Moyano from comment #21) > Hello Alex, awesome job!, it works great.. > > Just a little question.. > > I noticed that disabled plugins have the "run plugin" button enabled, and > when you click on it works.. > > shouldn't that button be disabled if you disable the entire plugin?.. or > this bug is intended only for hookup functions? Hello Agustín, IMO, disabled plugins can be run and configured in the "plugins area" (koha/plugins/*). The only thing this patch does is to prevent calls of disabled plugins anywhere else in Koha (hooks). I don't see any advantage of preventing uses of run or configure methods since you can just ignore them. But a hook calls systematically all plugins implementing a specific method and you might need that does not happen for one of them until your are done with the configuration (for exemple) without removing it from your server. Thx for testing!
Created attachment 89040 [details] [review] Bug 22053: create unit tests Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 89041 [details] [review] Bug 22053: ability to enable/disable some plugins Test plan: - apply this patch(es), - launch an updatedabase, - go to plugins/plugins-home.pl and deal with enable/disable method - install a plugin like KitchenSink https://github.com/bywatersolutions/koha-plugin-kitchen-sink - once installed, the plugin change the background color of the staff client to orange. - disable the plugin, - background color should be set back to the original one Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 89042 [details] [review] Bug 22053: update database Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 89043 [details] [review] Bug 22053: (QA follow-up) More tests This patch adds tests for: - $plugin->enable and $plugin->disable are chainable (i.e. return $self) - Disabled plugins don't inject routes To test: - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t \ t/db_dependent/Plugins.t => SUCCESS: Tests pass Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The updatedatabase fails for installations without plugins enabled
Created attachment 89116 [details] [review] Bug 22053: (QA follow-up) Override enable_plugins configuration This patch makes the update script override the configured enable_plugins setting in koha-conf.xml. on testing the failure I wrote trivial tests on how Koha::Plugins->new({ enable_plugins => 1 }) should work. Adding them to this patch as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Awesome work all! Pushed to master for 19.05
Created attachment 89551 [details] [review] Bug 22053: (QA follow-up) Fix tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
@RM, follow-up fixes the tests.
Created attachment 89558 [details] [review] Bug 22053: (QA follow-up) Fix tests This patch makes the tests enable the plugins that are required for them. Otherwise unexpected failures can happen Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Enhancement will not be backported to 18.11.x series.
(In reply to Tomás Cohen Arazi from comment #32) > @RM, follow-up fixes the tests. This has been pushed to master