Bug 23395 - batch operations on biblios/items should be able to pass a list of plugins
Summary: batch operations on biblios/items should be able to pass a list of plugins
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 22709
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-29 14:39 UTC by Tomás Cohen Arazi
Modified: 2020-03-31 19:34 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23395: Unit tests (6.25 KB, patch)
2019-07-30 12:53 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23395: Add a $plugins parameter to *Biblio and *Item methods (12.12 KB, patch)
2019-07-30 12:53 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23395: Add Test::NoWarrnings dependency (823 bytes, patch)
2019-07-30 12:54 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23395: Fetch the plugins only once in bulkmarcimport.pl (2.10 KB, patch)
2019-07-30 13:47 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-07-29 14:39:37 UTC
Even with bug 21073 pushed, there's no need to fetch the list of plugins implementing the required hooks, on each record in the loop. We should really make the plugins list a parameter to ModBiblio.
Comment 1 Tomás Cohen Arazi 2019-07-30 12:53:53 UTC
Created attachment 91870 [details] [review]
Bug 23395: Unit tests
Comment 2 Tomás Cohen Arazi 2019-07-30 12:53:56 UTC
Created attachment 91871 [details] [review]
Bug 23395: Add a $plugins parameter to *Biblio and *Item methods

This patch adds a $plugin parameter (the way those methods already
expect parameters) that is expected to contain an arrayref of plugin
object instances.

The target scenario are batch operations, in which we really don't want
to fetch the available plugins on each iteration.

This patch doesn't make batch-related scripts use this new option. It
will be done on a follow-up patch.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
=> SUCCESS: All tests pass, new tests as well
- Sign off :-D
Comment 3 Tomás Cohen Arazi 2019-07-30 12:54:00 UTC
Created attachment 91872 [details] [review]
Bug 23395: Add Test::NoWarrnings dependency
Comment 4 Tomás Cohen Arazi 2019-07-30 13:47:01 UTC
Created attachment 91874 [details] [review]
Bug 23395: Fetch the plugins only once in bulkmarcimport.pl
Comment 5 Tomás Cohen Arazi 2020-03-30 22:28:24 UTC
Why did I leave this one ASSIGNED?
Comment 6 David Nind 2020-03-31 19:34:29 UTC
Patch no longer applies:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 23395: Unit tests
Using index info to reconstruct a base tree...
M	t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
CONFLICT (content): Merge conflict in t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
error: Failed to merge in the changes.
Patch failed at 0001 Bug 23395: Unit tests