Bug 23395

Summary: batch operations on biblios/items should be able to pass a list of plugins
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Plugin architectureAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, fridolin.somers, josef.moravec, kyle, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 22709    
Bug Blocks:    
Attachments: Bug 23395: Unit tests
Bug 23395: Add a $plugins parameter to *Biblio and *Item methods
Bug 23395: Add Test::NoWarrnings dependency
Bug 23395: Fetch the plugins only once in bulkmarcimport.pl

Description Tomás Cohen Arazi (tcohen) 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 (tcohen) 2019-07-30 12:53:53 UTC
Created attachment 91870 [details] [review]
Bug 23395: Unit tests
Comment 2 Tomás Cohen Arazi (tcohen) 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 (tcohen) 2019-07-30 12:54:00 UTC
Created attachment 91872 [details] [review]
Bug 23395: Add Test::NoWarrnings dependency
Comment 4 Tomás Cohen Arazi (tcohen) 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 (tcohen) 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