Bug 16586

Summary: Koha Plugins: Limit results of GetPlugins by metadata
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Now we could find a plugin based on some metadata tag as returned by the plugin.
Version(s) released in:
Bug Depends on: 16502    
Bug Blocks: 15545    
Attachments: Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata
[SIGNED-OFF] Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata
Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata
Bug 16586: Simplify code using none
Bug 16586: [QA Follow-up] Add test for two metadata conditions
Bug 16586: Simplify code using none
Bug 16586: Simplify code using none
Bug 16586: [QA Follow-up] Simplify code

Description Marcel de Rooy 2016-05-25 11:39:51 UTC

    
Comment 1 Marcel de Rooy 2016-05-25 12:35:07 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2016-07-20 23:04:53 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-07-25 15:11:36 UTC
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>
Comment 4 Jonathan Druart 2016-07-25 15:11:41 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2016-07-26 12:04:24 UTC
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>
Comment 6 Marcel de Rooy 2016-07-26 12:04:27 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2016-07-26 12:05:38 UTC
(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..
Comment 8 Marcel de Rooy 2016-07-26 12:06:26 UTC
(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..
Comment 9 Marcel de Rooy 2016-07-27 11:16:42 UTC Comment hidden (obsolete)
Comment 10 Marcel de Rooy 2016-07-27 11:17:29 UTC
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.
Comment 11 Marcel de Rooy 2016-07-27 11:18:47 UTC
(In reply to Marcel de Rooy from comment #7)
> (In reply to Jonathan Druart from comment #4)

> Please correct..
Done
Comment 12 Kyle M Hall 2016-09-09 13:19:13 UTC
Pushed to master for 16.11, thanks Marcel, Jonathan!