[Bug 25961] New: Add hooks for plugins to inject variables to XSLT
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Bug ID: 25961 Summary: Add hooks for plugins to inject variables to XSLT 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: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org -- 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=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 106666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106666&action=edit [DO NOT PUSH] Bug 25961: Sample usage of the OPAC XSLT variables hooks Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- 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=25961 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 106667 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106667&action=edit Bug 25961: Add hooks for plugins to inject variables to OPAC XSLT This patch adds the following plugin hooks: - opac_results_xslt_variables - opac_detail_xslt_variables This hooks will inject variables returned by the plugin in the form of a hashref, into the ones that are passed to the XSLT processing code. To test: 1. Apply the 'DO NOT PUSH' commit 2. Install the Kitchensink plugin 3. Restart all 4. Search biblios in the OPAC => SUCCESS: A text is injected in front of the biblio title 5. Enter the detail page of any of the results => SUCCESS: A text is injected in front of the biblio title 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- 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=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- 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=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://github.com/bywaters | |olutions/koha-plugin-kitche | |n-sink/pull/12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Only to clarify the test plan: you need to apply both patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Kyle M Hall <kyle@bywatersolutions.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=25961 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106666|0 |1 is obsolete| | Attachment #106667|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 106832 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106832&action=edit Bug 25961: Sample usage of the OPAC XSLT variables hooks Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 106833 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106833&action=edit Bug 25961: Add hooks for plugins to inject variables to OPAC XSLT This patch adds the following plugin hooks: - opac_results_xslt_variables - opac_detail_xslt_variables This hooks will inject variables returned by the plugin in the form of a hashref, into the ones that are passed to the XSLT processing code. To test: 1. Apply the 'DO NOT PUSH' commit 2. Install the Kitchensink plugin 3. Restart all 4. Search biblios in the OPAC => SUCCESS: A text is injected in front of the biblio title 5. Enter the detail page of any of the results => SUCCESS: A text is injected in front of the biblio title 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106832|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106954&action=edit Bug 25961: Sample usage of the OPAC XSLT variables hooks Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106833|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106955 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106955&action=edit Bug 25961: Add hooks for plugins to inject variables to OPAC XSLT This patch adds the following plugin hooks: - opac_results_xslt_variables - opac_detail_xslt_variables This hooks will inject variables returned by the plugin in the form of a hashref, into the ones that are passed to the XSLT processing code. To test: 1. Apply the 'DO NOT PUSH' commit 2. Install the Kitchensink plugin 3. Restart all 4. Search biblios in the OPAC => SUCCESS: A text is injected in front of the biblio title 5. Enter the detail page of any of the results => SUCCESS: A text is injected in front of the biblio title 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, not regressions, no qa script failures.. Passing QA. Please make sure the new hook is well documented, both by adding it to the wiki and with an example use case somewhere perhaps. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I already documented it upon submission, but it is true that we would need a good example usage on the wiki. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #9)
I already documented it upon submission, but it is true that we would need a good example usage on the wiki.
Yes, please. I also created https://tree.taiga.io/project/koha-ils/task/75 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #10)
(In reply to Tomás Cohen Arazi from comment #9)
I already documented it upon submission, but it is true that we would need a good example usage on the wiki.
Yes, please. I also created https://tree.taiga.io/project/koha-ils/task/75
The fact that the KitchenSink plugin has a sample implementation, and the pointed bug supplies a sample XSLT making use of the variables, looks to me like a good source for documentation on the feature. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- More or less same code in two scripts ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #12)
More or less same code in two scripts ?
I don't know what that means. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #12)
More or less same code in two scripts ?
This is in line with the standard convention we have at this time. If you look at Biblio.pm, Item.pm, Patron.pm, Availability.pm, SuggestionEngineMean, didyoumean.pl, process_message_queue.pl, etc you'll see the same style code. Bug 24031 will introduce Koha::Plugins::call which we can use to simplify all these loops, but that should be done on a separate bug report to rework all those loops. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Kyle M Hall from comment #14)
(In reply to Marcel de Rooy from comment #12)
More or less same code in two scripts ?
This is in line with the standard convention we have at this time. If you look at Biblio.pm, Item.pm, Patron.pm, Availability.pm, SuggestionEngineMean, didyoumean.pl, process_message_queue.pl, etc you'll see the same style code.
Bug 24031 will introduce Koha::Plugins::call which we can use to simplify all these loops, but that should be done on a separate bug report to rework all those loops.
Could we imagine to have it done now, on top of all the bug reports that are PQA? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #15)
(In reply to Kyle M Hall from comment #14)
(In reply to Marcel de Rooy from comment #12)
More or less same code in two scripts ?
This is in line with the standard convention we have at this time. If you look at Biblio.pm, Item.pm, Patron.pm, Availability.pm, SuggestionEngineMean, didyoumean.pl, process_message_queue.pl, etc you'll see the same style code.
Bug 24031 will introduce Koha::Plugins::call which we can use to simplify all these loops, but that should be done on a separate bug report to rework all those loops.
Could we imagine to have it done now, on top of all the bug reports that are PQA?
It is done, on bug 26063. I marked it as depending on 24031 so it might have been missed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26063 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26063 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26063 [Bug 26063] Use Koha::Plugins->call for circulation hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106954|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 107477 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107477&action=edit Bug 25961: [DO NOT PUSH] Sample usage of the OPAC XSLT variables hooks Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|20.11.00 |20.11.00, 20.05.03 released in| | --- Comment #19 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #20 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Aleisha Amohia from comment #20)
enhancement, not backported to 19.11.x
This is a handy one :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 --- Comment #22 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Tomás Cohen Arazi from comment #21)
(In reply to Aleisha Amohia from comment #20)
enhancement, not backported to 19.11.x
This is a handy one :-)
It may be handy but it's still very much an enhancement and not fixing any bugs. I did discuss with Hayley and Chris and they agree that enhancements like these are just worth upgrading for. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=25961 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | Text to go in the| |This enhancement adds the release notes| |following plugin hooks: | |- | |opac_results_xslt_variables | |- | |opac_detail_xslt_variables | | | |This allows us to pass | |valuable information for | |XSLT customization. | | | |Plugins implementing this | |hooks, should return a | |hashref containing the | |variable names and values | |to be passed to the XSLT | |processing code. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org