Bug 16586 - Koha Plugins: Limit results of GetPlugins by metadata
Summary: Koha Plugins: Limit results of GetPlugins by metadata
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 16502
Blocks: 15545
  Show dependency treegraph
 
Reported: 2016-05-25 11:39 UTC by Marcel de Rooy
Modified: 2017-12-07 22:16 UTC (History)
1 user (show)

See Also:
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:
Circulation function:


Attachments
Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata (6.77 KB, patch)
2016-05-25 12:35 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata (6.77 KB, patch)
2016-07-20 23:04 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 16586: Koha Plugins: Limit results of GetPlugins by metadata (6.83 KB, patch)
2016-07-25 15:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16586: Simplify code using none (1.69 KB, patch)
2016-07-25 15:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16586: [QA Follow-up] Add test for two metadata conditions (1.46 KB, patch)
2016-07-26 12:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16586: Simplify code using none (1.73 KB, patch)
2016-07-26 12:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16586: Simplify code using none (1.88 KB, patch)
2016-07-27 11:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 16586: [QA Follow-up] Simplify code (1.88 KB, patch)
2016-07-27 11:17 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (khall) 2016-09-09 13:19:13 UTC
Pushed to master for 16.11, thanks Marcel, Jonathan!