From 6fcb2e378b9f5865b1c494685775fa9006ae5ba3 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 29 May 2025 12:01:12 +0000 Subject: [PATCH] Bug 40026: Edit item metadata should present Standard form if AutoILLBackendPriority is in use When the AutoILLBackendPriority system preference is enabled, the form that was used is always the Standard form, regardless of which backend the request ends up on. It only makes sense that when editing an ILL request's item metadata, the form shown is also the Standard form if AutoILLBackendPriority is in use. Test plan, k-t-d, don't apply patch: 1) Enable ILLModule 2) Install an external backend, e.g. the libkey lending tool (IncDocs) backend plugin: https://github.com/openfifth/koha-ill-libkey-lending-tool/releases/tag/v2.0.3 3) Restart plack $ koha-plack --restart kohadev 4) Create a new IncDocs ILL request: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=IncDocs 5) Add a DOI '123', a cardnumber '42' and any library. Click 'Make request'. 6) Enable AutoILLBackendPriority system preference by ticking 'IncDocs'. This is only done now to simplify the test plan, as creating an 'IncDocs' request using AutoILLBackendPriority requires credentials configuration. 7) Back on the 'Manage request' page for the request created in step 5, click 'Edit item metadata'. Notice the form shown is not the 'Standard' form (its the IncDocs one). Edit any of the metadata values, click 'Save'. Verify the new metadata is saved correctly. 8) Apply patch. Repeat 7). Notice the form shown is the 'Standard' form now. Edit any of the metadata values, click "Save". Verify the new medata is saved correctly. --- Koha/ILL/Request.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 9b151e3924c..7459d74ed26 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1161,7 +1161,9 @@ sub expand_template { my ( $self, $params ) = @_; my $backend = $self->_backend->name; - if ( $backend eq 'Standard' ) { + if ( $backend eq 'Standard' + || ( $params->{method} eq 'edititem' && C4::Context->preference("AutoILLBackendPriority") ) ) + { my $template_name = 'ill/backends/Standard/' . ( $params->{method} // q{} ) . '.inc'; -- 2.39.5