[Bug 39870] New: Add plugin hook for making arbitrary data available to notices
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Bug ID: 39870 Summary: Add plugin hook for making arbitrary data available to notices Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: lisette@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org This enhancement would add a plugin hook that could add 'plugin_data' or something to notices so plugins can return information into notices as the plugin needs something like this: [% plugin_content.plugin_name.value %] -- 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=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |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=39870 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 182265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182265&action=edit Bug 39870: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 182266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182266&action=edit Bug 39870: Add `notices_content()` plugin hook This patch adds a hook for adding information to notices context from plugins. The method is passed all the `GetPreparedLetter()` paramerters so it gets all the context for calculating the values to pass the template. The main target use for this hook is ILL, where we need to identify candidate ILL requests related to the filled hold for printing the right ILL-related message. The implementation is generic so it can be used for any other use case. To test: 1. Apply the unit tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => FAIL: The hook is not implemented, the letter doesn't include plugin-calculated data the tests expect. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182265|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 182293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182293&action=edit Bug 39870: Unit tests Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182266|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 182294 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182294&action=edit Bug 39870: Add `notices_content()` plugin hook This patch adds a hook for adding information to notices context from plugins. The method is passed all the `GetPreparedLetter()` paramerters so it gets all the context for calculating the values to pass the template. The main target use for this hook is ILL, where we need to identify candidate ILL requests related to the filled hold for printing the right ILL-related message. The implementation is generic so it can be used for any other use case. To test: 1. Apply the unit tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => FAIL: The hook is not implemented, the letter doesn't include plugin-calculated data the tests expect. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182293|0 |1 is obsolete| | --- Comment #5 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 182418 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182418&action=edit Bug 39870: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182294|0 |1 is obsolete| | --- Comment #6 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 182419 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182419&action=edit Bug 39870: Add `notices_content()` plugin hook This patch adds a hook for adding information to notices context from plugins. The method is passed all the `GetPreparedLetter()` paramerters so it gets all the context for calculating the values to pass the template. The main target use for this hook is ILL, where we need to identify candidate ILL requests related to the filled hold for printing the right ILL-related message. The implementation is generic so it can be used for any other use case. To test: 1. Apply the unit tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => FAIL: The hook is not implemented, the letter doesn't include plugin-calculated data the tests expect. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lisette@bywatersolutions.co |y.org |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #7 from Lisette Scheer <lisette@bywatersolutions.com> --- Worked great and this will be great for passing ILL information to notices from plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please update https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu --- Comment #10 from Michaela Sieber <michaela.sieber@kit.edu> --- I added a line under Implemented hooks on the wiki page https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks Please review if everything is correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks! We still need release notes! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #12 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Thank you both. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 --- Comment #13 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #11)
Thanks! We still need release notes!
And this should go to the manual I guess. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This development allows release notes| |plugins to make arbitrary | |data available to notices. | | | |Each plugin has a defined | |namespace (e.g. | |'innreach'). If a plugin | |implements the | |`notices_content` method, | |it will be called. The | |generated data structure it | |returns will be available | |to the notice author as `[% | |plugin_content.innreach | |%]`. | | | |The hook will be | |passed the notice | |generation context, so | |authors can return | |different information based | |on what they need for each | |letter, for example. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40037 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40037 [Bug 40037] Redundant check in `notices_content` hook handling -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39870 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 24.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org