Bug 16502: Table koha_plugin_com_bywatersolutions_kitchensink_mytable not always...
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 16 May 2016 15:19:54 +0000 (17:19 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 7 Jul 2016 23:06:29 +0000 (11:06 +1200)
commit6a06f60a1ee928c2b6859b2e14e959dc98df2ce5
tree14e094fb7e36c356c7cc5400d9cba2d68dd909f8
parent402c827fb9eca20089ecf328b576785298377545
Bug 16502: Table koha_plugin_com_bywatersolutions_kitchensink_mytable not always dropped after running Plugin.t

If you run Plugin.t, the above table will still be present (when you
did not enable UseKohaPlugins). This would trigger a warning when
running the test a second time.

Why? The uninstall call does its work not completely due to a small
inconsistency in Koha::Plugins::Handler::delete when calling run
without the enable_plugins parameter.

This patch resolves that inconsistency and also removes an unneeded skip
in Plugin.t in case the KitchenSink module already exists.
Note: This is a small fix. But I wonder if the Handler routines run and
delete should not have been implemented in Koha::Plugins::Base.
Also note that plugins/plugins-uninstall.pl will not be affacted by this
change, since it checks whether the pref is enabled before calling the
delete method.

Test plan:
[1] Do not yet install this patch.
[2] Verify that plugins are enabled in koha-conf.xml.
[3] Disable UseKohaPlugins in System Preferences!
[4] Run t/db_dependent/Plugins.t.
[5] Verify that table koha_plugin_com_bywatersolutions_kitchensink_mytable
    still exists. (It should have been deleted.) Remove it manually.
[6] Apply this patch.
[7] Run the test again.
[8] Verify that the table does not exist.
[9] Run the test again (without warnings).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4263ac2b92737024d8d620a751babf72b904b73a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4ebe7b489c9798d2456bd3de1d95ec6e027b2b21)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit 752e31425efa34fa6f21446fb18cf34ba31fc441)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Koha/Plugins/Handler.pm
t/db_dependent/Plugins.t