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: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/