[Koha-bugs] [Bug 19605] ILL backends should be pluggable through regular Koha plugins

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Mar 9 14:08:20 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605

--- Comment #26 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 163006
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163006&action=edit
Bug 19605: Rename method and use the instantiated plugin in the call

This patch makes the backend instantiation happen through a plugin
object method instead of a static one. This way, the (already)
instantiated plugin can be reused (if needed) in the plugin workflow
like this:

sub new_il_backend {
    my ($self, $params) = @_;
    return Custom::Backend->new(
        {
            config => $params->{config},
            logger => $params->{logger},
            plugin => $self,
        }
    );
}

The passed plugin object would then be used to retrieve whatever
plugin-defined configurations, template paths or even helper methods. On
INN-Reach, it gives the backend access to API user agents, task queue
injection, etc.

This patch also renames the method so it is more straight-forward this is
related to ILL.

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list