[Bug 39031] New: ILL plugins should provide themselves the template path
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Bug ID: 39031 Summary: ILL plugins should provide themselves the template path Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: pedro.amorim@ptfs-europe.com, tomascohen@gmail.com Right now, Koha assumes (in `Koha::ILL::Request->expand_template`) that `$plugin->new_ill_backend` returns a Koha::Plugin object that implements the required methods for acting like a proper ILL backend. This is implied by the internal use of `bundle_path`: ```perl my $backend_plugin = $self->get_backend_plugin( $self->_backend->name ); if ($backend_plugin) { # New way of loading backends: Through plugins $backend_dir = $backend_plugin->bundle_path; $backend_tmpl = $backend_dir; ``` I'm writing a backend plugin that has a convenient `templates/` dir to better organize the many pieces. My `new_ill_backend()` method returns a new object that is designed to eventually inherit from `Koha::ILL::Backend` when time comes. The current implementation assumes that everything is contained in the plugin's bundle path in a very specific way. I propose we either allow the backend to tell where to look for templates: ```diff - $backend_dir = $backend_plugin->bundle_path; + $backend_dir = $self->_backend->template_path; ``` or implement a plugin method for the job: ```diff - $backend_dir = $backend_plugin->bundle_path; + $backend_dir = $backend_plugin->ill_template_path; ``` i.e. just implement a plugin method, that will return the path for querying the backend templates I'd go with the first option, leaving it to the author's creativity to organize things the way they want. -- 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=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19605 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 [Bug 19605] ILL backends should be pluggable through regular Koha plugins -- 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=39031 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I feel like just changing it like this would be flexible enough, while keeping the current behavior for plugin-as-a-backend implementations: ```diff - $backend_dir = $backend_plugin->bundle_path; + $backend_dir = $self->_backend->bundle_path; ``` The only weird thing that will be left in this scenario, is that both `$backend_plugin` and `$self->_backend` are instances of the same plugin... just with some extra internal variables set by `new_ill_backend()`. But in this context we already have an instance of the plugin, loaded 'as a backend' by `new_ill_backend()`. So it is redundant to instantiate the plugin, it seems. -- 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=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- 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=39031 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 177533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177533&action=edit Bug 39031: Use the backend's bundle_path() method 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=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |pedro.amorim@ptfs-europe.co |y.org |m Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Assigning Pedro for QA to get his review. -- 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=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_05_candidate, | |rel_24_11_candidate --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- And please backport :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|pedro.amorim@ptfs-europe.co |testopia@bugs.koha-communit |m |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=39031 Jesse Maseto <jesse@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=39031 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177533|0 |1 is obsolete| | --- Comment #5 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 180483 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180483&action=edit Bug 39031: Use the backend's bundle_path() method Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #6 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- No longer applies after bug 38340 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |pedro.amorim@openfifth.co.u |y.org |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_11_candidate |rel_25_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_25_11_candidate | CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org