From b88aed78a70c0ec8beb855858269b0f3e9446d6d 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. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Lucas Gass (cherry picked from commit ed3b233f638d071430135ab8f3ff1d43a593da5c) Signed-off-by: Paul Derscheid --- 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 4c8453d4dd..42a563d8b0 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';