[Bug 19605] New: ILL backends should be pluggable through regular Koha plugins
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Bug ID: 19605 Summary: ILL backends should be pluggable through regular Koha plugins Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Right now, the ILL module requires a configuration entry for a path in which to look for the backend implementations. This should be implemented in a more simple way for end-users. -- 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=19605 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |7317 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7317 [Bug 7317] Add an Interlibrary Loan Module to Circulation and OPAC -- 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=19605 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=7317 -- 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=19605 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19822 -- 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20536 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20536 [Bug 20536] ILL: authnotrequired not explicitly unset -- 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|20536 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20536 [Bug 20536] ILL: authnotrequired not explicitly unset -- 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=19605 Bug 19605 depends on bug 7317, which changed state. Bug 7317 Summary: Add an Interlibrary Loan Module to Circulation and OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7317 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Depends on|7317 |18589 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7317 [Bug 7317] Add an Interlibrary Loan Module to Circulation and OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18589 [Bug 18589] Show ILLs as part of patron profile -- 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19822 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19822 [Bug 19822] Add system preferences for ILL Module -- 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=19605 Bug 19605 depends on bug 18589, which changed state. Bug 18589 Summary: Show ILLs as part of patron profile https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18589 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- 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=19605 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew.isherwood@ptfs-europ | |e.com Depends on|18589 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18589 [Bug 18589] Show ILLs as part of patron profile -- 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=19605 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Andrew Isherwood <bugzilla@warmlight.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|bugzilla@warmlight.co.uk | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23578 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23578 [Bug 23578] Koha ILL backends directory is not included in @INC -- 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=19605 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- +100 :) -- 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=19605 --- Comment #2 from Michal Denar <black23@gmail.com> --- +100 too :-) -- 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=19605 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|19822 | Depends on| |19822 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19822 [Bug 19822] Add system preferences for ILL Module -- 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=19605 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Lets make this happen for 23.11 :) -- 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=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |ILL |and plumbing | CC| |pedro.amorim@ptfs-europe.co | |m -- 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=19605 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Martin Renvoize from comment #3)
Lets make this happen for 23.11 :)
+ 1 :) -- 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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |pedro.amorim@ptfs-europe.co |ity.org |m Status|NEW |ASSIGNED -- 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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158068&action=edit Bug 19605: Add 'ill_backend' plugin category -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158069 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158069&action=edit Bug 19605: Update expandTemplate to expand_template method name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158070&action=edit Bug 19605: Add support for ILL backends as plugins This is designed to maintain existing functionality of loading ILL backends through the backend_dir config (default Koha/Illbackends/). A check for a plugin of a given backend name takes precedence over a backend of the same name loaded the old way through backend_dir, this means that if this happens, the backend plugin is used and NOT the backend present in backend_dir. Old backend_dir backends AND new backend plugins coexist. Test plan, k-t-d: 1) Enable ILLModule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.s...) 2) Install the plugin ILL backend example .kpz located at: https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0 3) koha-plack --restart kohadev 4) Visit ILL requests: /cgi-bin/koha/ill/ill-requests.pl 5) Click "+ New ILL request". Notice it lists 'FreeForm' and 'PluginBackend' 6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber and pick a library. Click 'Marke request' 7) Notice the request is created successfully. 8) Visit plugins: /cgi-bin/koha/plugins/plugins-home.pl 9) Click "View plugin by class". Pick "ill backend plugins". Notice the correct plugin is listed. 10) Click "configure" on the ILL backend plugin. Notice it's a normal plugin configuration page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #8 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Instructions on converting old ILL backend into a plugin can be found at the PluginBackend sample plugin https://github.com/ammopt/koha-ill-backend-plugin: - Create your plugin, copy the contents from your old ILL backend into the plugin folder. - Copy the code from your old Base.pm file into the plugin file named after the plugin. - Rename the old backend 'metadata' method to 'backend_metadata'. - Rename the old backend 'new' method to 'new_backend'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #9 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- My suggestions is that we support both ways of loading ILL backends (old backend_dir way and this new plugin way) for a while (1 year? 2 years?) and after that period we deprecate the old backend_dir way of doing things. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Pedro Amorim from comment #9)
My suggestions is that we support both ways of loading ILL backends (old backend_dir way and this new plugin way) for a while (1 year? 2 years?) and after that period we deprecate the old backend_dir way of doing things.
That sounds like a good plan. We should make sure the deprecation warning is well visible, in the Relase notes and on the wiki page and maybe the manual? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #11 from Magnus Enger <magnus@libriotech.no> --- (In reply to Pedro Amorim from comment #9)
My suggestions is that we support both ways of loading ILL backends (old backend_dir way and this new plugin way) for a while (1 year? 2 years?) and after that period we deprecate the old backend_dir way of doing things.
That sounds like a most excellent plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35581 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35581 [Bug 35581] ILL Koha classes are not consistent -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 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=19605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158068|0 |1 is obsolete| | --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 160433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160433&action=edit Bug 19605: Add 'ill_backend' plugin category 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=19605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158069|0 |1 is obsolete| | --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 160434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160434&action=edit Bug 19605: Update expandTemplate to expand_template method name 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=19605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158070|0 |1 is obsolete| | --- Comment #14 from David Nind <david@davidnind.com> --- Created attachment 160435 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160435&action=edit Bug 19605: Add support for ILL backends as plugins This is designed to maintain existing functionality of loading ILL backends through the backend_dir config (default Koha/Illbackends/). A check for a plugin of a given backend name takes precedence over a backend of the same name loaded the old way through backend_dir, this means that if this happens, the backend plugin is used and NOT the backend present in backend_dir. Old backend_dir backends AND new backend plugins coexist. Test plan, k-t-d: 1) Enable ILLModule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.s...) 2) Install the plugin ILL backend example .kpz located at: https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0 3) koha-plack --restart kohadev 4) Visit ILL requests: /cgi-bin/koha/ill/ill-requests.pl 5) Click "+ New ILL request". Notice it lists 'FreeForm' and 'PluginBackend' 6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber and pick a library. Click 'Marke request' 7) Notice the request is created successfully. 8) Visit plugins: /cgi-bin/koha/plugins/plugins-home.pl 9) Click "View plugin by class". Pick "ill backend plugins". Notice the correct plugin is listed. 10) Click "configure" on the ILL backend plugin. Notice it's a normal plugin configuration page 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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|19822 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19822 [Bug 19822] Add system preferences for ILL Module -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I been looking at the PluginBackend implementation, and got a bit confused about this: sub new_backend { my ( $class, $params ) = @_; my $self = {}; $self->{_logger} = $params->{logger} if ( $params->{logger} ); $self->{_config} = $params->{config} if ( $params->{config} ); bless( $self, $class ); return $self; } It seems to me that in this particular implementation, as we already have a plugin instance in this context: + my $backend_plugin = $self->get_backend_plugin($backend_name); + if ($backend_plugin) { + + # New way of loading backends: Through plugins + my $backend_plugin_class = $backend_plugin->{class}; + + $self->{_my_backend} = $backend_plugin_class->new_backend( it doesn't make sense to instantiate the plugin again. Thus, the PluginBackend implementation could just be: sub new_backend { my ($self,$params) = @_; $self->{_logger} = $params->{logger} if ( $params->{logger} ); $self->{_config} = $params->{config} if ( $params->{config} ); return $self; } I would rather rename the method to `get_ill_backend`, and leave the plugin authors the decision on what to return (the name change is a matter of taste, but I think `ill` needs to be part of the method name). In my case, I would love to be able to (say) have my own class for the backend, so my implementation would be written like this: sub get_ill_backend { my ($self,$params) = @_; require INNReach::ILL::Backend; return INNReach::ILL::Backend->new({ plugin => $self, logger => $params->{logger} }); } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=19605 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160433|0 |1 is obsolete| | Attachment #160434|0 |1 is obsolete| | Attachment #160435|0 |1 is obsolete| | --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 162996 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162996&action=edit Bug 19605: Add 'ill_backend' plugin category 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=19605 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 162997 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162997&action=edit Bug 19605: Update expandTemplate to expand_template method name 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=19605 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 162998 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162998&action=edit Bug 19605: Add support for ILL backends as plugins This is designed to maintain existing functionality of loading ILL backends through the backend_dir config (default Koha/Illbackends/). A check for a plugin of a given backend name takes precedence over a backend of the same name loaded the old way through backend_dir, this means that if this happens, the backend plugin is used and NOT the backend present in backend_dir. Old backend_dir backends AND new backend plugins coexist. Test plan, k-t-d: 1) Enable ILLModule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.s...) 2) Install the plugin ILL backend example .kpz located at: https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0 3) koha-plack --restart kohadev 4) Visit ILL requests: /cgi-bin/koha/ill/ill-requests.pl 5) Click "+ New ILL request". Notice it lists 'FreeForm' and 'PluginBackend' 6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber and pick a library. Click 'Marke request' 7) Notice the request is created successfully. 8) Visit plugins: /cgi-bin/koha/plugins/plugins-home.pl 9) Click "View plugin by class". Pick "ill backend plugins". Notice the correct plugin is listed. 10) Click "configure" on the ILL backend plugin. Notice it's a normal plugin configuration page 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=19605 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 162999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162999&action=edit Bug 19605: Tidy Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163000 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163000&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@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163001 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163001&action=edit Bug 19605: Clarify method name Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162996|0 |1 is obsolete| | Attachment #162997|0 |1 is obsolete| | Attachment #162998|0 |1 is obsolete| | Attachment #162999|0 |1 is obsolete| | Attachment #163000|0 |1 is obsolete| | Attachment #163001|0 |1 is obsolete| | --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163002 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163002&action=edit Bug 19605: Add 'ill_backend' plugin category Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #23 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163003 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163003&action=edit Bug 19605: Update expandTemplate to expand_template method name Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163004 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163004&action=edit Bug 19605: Add support for ILL backends as plugins This is designed to maintain existing functionality of loading ILL backends through the backend_dir config (default Koha/Illbackends/). A check for a plugin of a given backend name takes precedence over a backend of the same name loaded the old way through backend_dir, this means that if this happens, the backend plugin is used and NOT the backend present in backend_dir. Old backend_dir backends AND new backend plugins coexist. Test plan, k-t-d: 1) Enable ILLModule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.s...) 2) Install the plugin ILL backend example .kpz located at: https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0 3) koha-plack --restart kohadev 4) Visit ILL requests: /cgi-bin/koha/ill/ill-requests.pl 5) Click "+ New ILL request". Notice it lists 'FreeForm' and 'PluginBackend' 6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber and pick a library. Click 'Marke request' 7) Notice the request is created successfully. 8) Visit plugins: /cgi-bin/koha/plugins/plugins-home.pl 9) Click "View plugin by class". Pick "ill backend plugins". Notice the correct plugin is listed. 10) Click "configure" on the ILL backend plugin. Notice it's a normal plugin configuration page Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #25 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163005 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163005&action=edit Bug 19605: Tidy Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #26 from Tomás Cohen Arazi <tomascohen@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@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #27 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163007&action=edit Bug 19605: Clarify method name Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #28 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Sorry for the noise, I forgot to stamp my signature. Remarks: * I will submit on a follow-up bug an idea for some error checking we are lacking here. No rush though. Will do on monday for sure. * I didn't understand why you changed the expandTemplate method name here. No problem for me but we usually do it on a separate report. * I'm not sure we should tag 'this is the new way' in the code, as it might be confusing for readers a couple months later. I fixed this in one place, making the code and comments assume 'plugins is the way' and the 'old one' is a 'fallback' mechanism. I prefer such terminology. This all looks great. Awesome job! Sorry for the delay! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://github.com/ammopt/k | |oha-ill-backend-plugin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #29 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I've just sent a PR for adjusting the sample plugin to the proposed changes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL|https://github.com/ammopt/k |https://github.com/PTFS-Eur |oha-ill-backend-plugin |ope/koha-ill-backend-plugin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #30 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 163846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163846&action=edit Bug 19605: Fix after bug 35536 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163002|0 |1 is obsolete| | --- Comment #31 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164084 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164084&action=edit Bug 19605: Add 'ill_backend' plugin category Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163003|0 |1 is obsolete| | --- Comment #32 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164085 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164085&action=edit Bug 19605: Update expandTemplate to expand_template method name Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163004|0 |1 is obsolete| | --- Comment #33 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164086 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164086&action=edit Bug 19605: Add support for ILL backends as plugins This is designed to maintain existing functionality of loading ILL backends through the backend_dir config (default Koha/Illbackends/). A check for a plugin of a given backend name takes precedence over a backend of the same name loaded the old way through backend_dir, this means that if this happens, the backend plugin is used and NOT the backend present in backend_dir. Old backend_dir backends AND new backend plugins coexist. Test plan, k-t-d: 1) Enable ILLModule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.s...) 2) Install the plugin ILL backend example .kpz located at: https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0 3) koha-plack --restart kohadev 4) Visit ILL requests: /cgi-bin/koha/ill/ill-requests.pl 5) Click "+ New ILL request". Notice it lists 'FreeForm' and 'PluginBackend' 6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber and pick a library. Click 'Marke request' 7) Notice the request is created successfully. 8) Visit plugins: /cgi-bin/koha/plugins/plugins-home.pl 9) Click "View plugin by class". Pick "ill backend plugins". Notice the correct plugin is listed. 10) Click "configure" on the ILL backend plugin. Notice it's a normal plugin configuration page Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163005|0 |1 is obsolete| | --- Comment #34 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164087 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164087&action=edit Bug 19605: Tidy Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163006|0 |1 is obsolete| | --- Comment #35 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164088&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@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163007|0 |1 is obsolete| | --- Comment #36 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164089&action=edit Bug 19605: Clarify method name Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163846|0 |1 is obsolete| | --- Comment #37 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164090&action=edit Bug 19605: Fix after bug 35536 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 --- Comment #38 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 164091 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164091&action=edit Bug 19605: Another fix after bug 35536 Signed-off-by: Pedro Amorim <pedro.amorim@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=19605 --- Comment #39 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Tomás Cohen Arazi from comment #29)
I've just sent a PR for adjusting the sample plugin to the proposed changes.
I got some errors testing it and followed up, please take a look when possible: https://github.com/PTFS-Europe/koha-ill-backend-plugin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #40 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Pedro Amorim from comment #39)
(In reply to Tomás Cohen Arazi from comment #29)
I've just sent a PR for adjusting the sample plugin to the proposed changes.
I got some errors testing it and followed up, please take a look when possible: https://github.com/PTFS-Europe/koha-ill-backend-plugin
You're rigth with the fix. Sorry for that! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org --- Comment #41 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Update to the test plan: When installing the pluginBackend, please install version 2.0.5 here: https://github.com/PTFS-Europe/koha-ill-backend-plugin/releases/tag/v2.0.5 It contains the latest CSRF compatibility changes required to create an ILL request on master for this backend. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36650 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36650 [Bug 36650] When uninstalling an ILL backend plugin, check if it can be uninstalled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 --- Comment #42 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 165201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165201&action=edit Bug 19605: (QA follow-up): available_backends fix reduce available_backends was only considering dir backends for reduce, it should consider all backends, including plugin backends. This relates to the ILLOpacbackends syspref, where if you add a backend name that happens to be a plugin, it was not disabling it for the OPAC. This change considers all backends for Illopacbackends, regardless of if its a plugin or a directory backend. This was made evident while writing tests for bug 36197. Regression tests for this particular use case, and others, are part of bug 36197. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.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=19605 --- Comment #43 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.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=19605 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #44 from Fridolin Somers <fridolin.somers@biblibre.com> --- Not backported to 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|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=19605 --- Comment #45 from David Cook <dcook@prosentient.com.au> --- It'd be great to get some clear documentation on this, as conceptually the idea of providing ILL backends via Koha plugins sounds great. I'm intrigued by the idea of an ISO 18626 ILL Koha plugin, although not sure if it would be that straightforward or if backends like Rapido and ReShare would need their own plugins. Waiting to hear back libraries about workflows... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38761 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38761 [Bug 38761] Backend plugins that are disabled remain visible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19605 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39031 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39031 [Bug 39031] ILL plugins should provide themselves the template path -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org