Created attachment 51771 [details] [review] Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata It would be helpful if we could find a plugin based on some metadata tag as returned by the plugin. This extends the use of GetPlugins that already supports searching on method. GetPlugins is used in: admin/edi_accounts.pl, plugins/plugins-home.pl and tools/stage-marc-import.pl. The changes in these three scripts are minimal and just related to parameter passing. Test t/db_dependent/Plugins.t includes another test for GetPlugins. In this regard a metadata tag has been added to t/Koha/Plugins/Test.pm. NOTE: This adjustment will also be used in a redesign for bug 15545. Test plan: Run t/db_dependent/Plugins.t. Enable pref UseKohaPlugins and config var enable_plugins. Go to plugins-home.pl. Verify that it still lists your plugins. Bonus: Check edi_accounts or stage-marc-import.pl if you have a working plugin for that.
Created attachment 53544 [details] [review] [SIGNED-OFF] Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata It would be helpful if we could find a plugin based on some metadata tag as returned by the plugin. This extends the use of GetPlugins that already supports searching on method. GetPlugins is used in: admin/edi_accounts.pl, plugins/plugins-home.pl and tools/stage-marc-import.pl. The changes in these three scripts are minimal and just related to parameter passing. Test t/db_dependent/Plugins.t includes another test for GetPlugins. In this regard a metadata tag has been added to t/Koha/Plugins/Test.pm. NOTE: This adjustment will also be used in a redesign for bug 15545. Test plan: Run t/db_dependent/Plugins.t. Enable pref UseKohaPlugins and config var enable_plugins. Go to plugins-home.pl. Verify that it still lists your plugins. Bonus: Check edi_accounts or stage-marc-import.pl if you have a working plugin for that. Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Created attachment 53691 [details] [review] Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata It would be helpful if we could find a plugin based on some metadata tag as returned by the plugin. This extends the use of GetPlugins that already supports searching on method. GetPlugins is used in: admin/edi_accounts.pl, plugins/plugins-home.pl and tools/stage-marc-import.pl. The changes in these three scripts are minimal and just related to parameter passing. Test t/db_dependent/Plugins.t includes another test for GetPlugins. In this regard a metadata tag has been added to t/Koha/Plugins/Test.pm. NOTE: This adjustment will also be used in a redesign for bug 15545. Test plan: Run t/db_dependent/Plugins.t. Enable pref UseKohaPlugins and config var enable_plugins. Go to plugins-home.pl. Verify that it still lists your plugins. Bonus: Check edi_accounts or stage-marc-import.pl if you have a working plugin for that. Signed-off-by: Liz Rea <liz@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53692 [details] [review] Bug 16586: Simplify code using none Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53717 [details] [review] Bug 16586: [QA Follow-up] Add test for two metadata conditions Run the test and see.. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 53718 [details] [review] Bug 16586: Simplify code using none Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #4) > Created attachment 53692 [details] [review] [review] > Bug 16586: Simplify code using none > > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Thx for QAing. I have the impression that your follow-up slightly changes behavior. It appears to be not as simple after all :) Check the code for the situation that %$req_metadata is empty. The additional unit test in my follow-up will prove it for you: run this test with and without your last patch. Please correct..
(In reply to Marcel de Rooy from comment #7) > Check the code for the situation that %$req_metadata is empty. Sorry this line makes no sense. Just run the test..
Created attachment 53747 [details] [review] Bug 16586: Simplify code using none Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Amended this patch: Replaced none by any. Exists test adjusted. This effectively makes the test pass.
Created attachment 53748 [details] [review] Bug 16586: [QA Follow-up] Simplify code Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Amended this patch: Replaced none by any. Exists test adjusted. This effectively makes the test pass.
(In reply to Marcel de Rooy from comment #7) > (In reply to Jonathan Druart from comment #4) > Please correct.. Done
Pushed to master for 16.11, thanks Marcel, Jonathan!