[Bug 31734] New: Hooks for account, recall, indexing and more actions for holds.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 Bug ID: 31734 Summary: Hooks for account, recall, indexing and more actions for holds. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: stefan.berndtsson@ub.gu.se QA Contact: testopia@bugs.koha-community.org This patch adds a few more hooks and extensions to an existing hook. The existing hook "after_hold_action" has been extended with the following actions: * "transfer" for when a Hold calls "set_transfer()". * "waiting" for when a Hold calls "set_waiting()". * "processing" for when a Hold calls "set_processing()". A new hook "after_account_action" is added with action "add_credit" for when credit is added via for example PAYMENT or WRITEOFF. This is consistent with when UpdateStats is called so that a plugin can be used to log the same kind of data as the normal statistics. Another new hook "after_recall_action" with action "add_recall" is also added. Also to stay consistent with the UpdateStats usage. Lastly a hook "before_index_action" with action "update" is added for the Elasticsearch::Indexer function "update_index()" so that the records being indexed can be modified before indexing. This allows for a plugin to add metadata to index or tweak or change it to provide better search results without changing the actual records (something that might be prohibited or discouraged due to centralised cataloging). Tests are provided in the patch. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 --- Comment #1 from Stefan Berndtsson <stefan.berndtsson@ub.gu.se> --- Created attachment 141602 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141602&action=edit Bug 31734: Extend hooks for plugins Hooks added: after_account_action / add in Koha::Account::add_credit when adding credit for payment or writeoff. after_hold_action / transfer, waiting and processing in Koha::Hold::set_* after_recall_action / add in Koha::Recalls::add_recall when adding recall before_index_action / update in Koha::SearchEngine::Elasticsearch::Indexer::update_index before actually updating the index Tests added for all new hooks. How to test: 1) Run tests in t/db_dependent/Koha/Plugins/Account_hooks.t 2) Run tests in t/db_dependent/Koha/Plugins/Elasticsearch_Indexer_hooks.t 3) Run tests in t/db_dependent/Koha/Plugins/Holds_hooks.t 4) Run tests in t/db_dependent/Koha/Plugins/Recall_hooks.t Sponsored by: Gothenburg University Library -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 Stefan Berndtsson <stefan.berndtsson@ub.gu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |stefan.berndtsson@ub.gu.se |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Stefan, in general it's recommended to break up work into smaller granular features. They usually go in much faster, the smaller the change is, as a question or problem doesn't cause a hold up so easily. In this case, I think it would have made sense to have separate bugs for holds, accounts, indexing and recalls. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 Stefan Berndtsson <stefan.berndtsson@ub.gu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #3 from Stefan Berndtsson <stefan.berndtsson@ub.gu.se> --- I didn't see this as that big of a thing, but ok. There are now the bugs: Bug 31894 (Hold) Bug 31895 (Account) Bug 31896 (Recall) Bug 31897 (Index) I guess this one can be closed then. Should it just be set to resolved, or is there another procedure? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31894, 31895, 31896, 31897 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31894 [Bug 31894] Extend Hold hooks with more actions https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31895 [Bug 31895] New Account hook when adding credit https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31896 [Bug 31896] New Recall hook when adding recall https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31897 [Bug 31897] New hook when indexing with Elasticsearch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Hooks for account, recall, |Hooks for account, recall, |indexing and more actions |indexing and more actions |for holds. |for holds --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Stefan it looks like the bugs are progressing nicely now :) I have linked them to this bug in a way we do for 'omnibus' bugs, that combine several issues about a topic. Could you please update the wiki page for hooks when these are pushed? https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've updated the wiki with some basic information, but couldn't provide the full descriptions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31734 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Only bug 31897 is missing here now! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org