Bug 40026 - Edit item metadata should present Standard form if AutoILLBackendPriority is in use
Summary: Edit item metadata should present Standard form if AutoILLBackendPriority is ...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-29 12:39 UTC by Pedro Amorim
Modified: 2025-06-16 21:34 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40026: Edit item metadata should present Standard form if AutoILLBackendPriority is in use (2.93 KB, patch)
2025-05-29 12:40 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Update edit item metadata screen header (1010 bytes, patch)
2025-05-29 12:40 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: 'Cancel' edit item metadata returns to request, not table view (1.37 KB, patch)
2025-05-29 12:40 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Edit item metadata should present Standard form if AutoILLBackendPriority is in use (3.12 KB, patch)
2025-06-02 08:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Update edit item metadata screen header (1010 bytes, patch)
2025-06-02 08:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: 'Cancel' edit item metadata returns to request, not table view (1.37 KB, patch)
2025-06-02 08:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Edit item metadata should present Standard form if AutoILLBackendPriority is in use (2.29 KB, patch)
2025-06-16 09:17 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Update edit item metadata screen header (1010 bytes, patch)
2025-06-16 09:17 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: 'Cancel' edit item metadata returns to request, not table view (1.37 KB, patch)
2025-06-16 09:17 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40026: Edit item metadata should present Standard form if AutoILLBackendPriority is in use (2.33 KB, patch)
2025-06-16 21:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 40026: Update edit item metadata screen header (1.03 KB, patch)
2025-06-16 21:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 40026: 'Cancel' edit item metadata returns to request, not table view (1.42 KB, patch)
2025-06-16 21:05 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-05-29 12:39:13 UTC

    
Comment 1 Pedro Amorim 2025-05-29 12:40:38 UTC
Created attachment 182836 [details] [review]
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:
   <staff_url>/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 the 'Standard' form. Edit any of the metadata values, click 'Save'. Verify the new metadata is saved correctly.
Comment 2 Pedro Amorim 2025-05-29 12:40:41 UTC
Created attachment 182837 [details] [review]
Bug 40026: Update edit item metadata screen header
Comment 3 Pedro Amorim 2025-05-29 12:40:43 UTC
Created attachment 182838 [details] [review]
Bug 40026: 'Cancel' edit item metadata returns to request, not table view
Comment 4 David Nind 2025-06-01 20:56:02 UTC
Not sure what to do after step 7 for testing - no patch is applied yet.

After that step, I applied the patch and restarted everything.

Now when I access the ILL request I created, I get a 500 error - which I assume is because of step 6 that credentials are required.
Comment 5 Pedro Amorim 2025-06-02 08:47:53 UTC
Created attachment 182898 [details] [review]
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:
   <staff_url>/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.
Comment 6 Pedro Amorim 2025-06-02 08:47:57 UTC
Created attachment 182899 [details] [review]
Bug 40026: Update edit item metadata screen header
Comment 7 Pedro Amorim 2025-06-02 08:48:00 UTC
Created attachment 182900 [details] [review]
Bug 40026: 'Cancel' edit item metadata returns to request, not table view
Comment 8 Pedro Amorim 2025-06-02 08:49:05 UTC
(In reply to David Nind from comment #4)
> Not sure what to do after step 7 for testing - no patch is applied yet.
> 
> After that step, I applied the patch and restarted everything.
> 
> Now when I access the ILL request I created, I get a 500 error - which I
> assume is because of step 6 that credentials are required.

Hi David thank you for your time here. It appears I've had an incomplete test plan, apologies for that.
I've updated the test plan, would you please take a look again when convenient? Thank you.
Comment 9 David Nind 2025-06-16 06:23:41 UTC
(In reply to Pedro Amorim from comment #8)
> (In reply to David Nind from comment #4)
> > Not sure what to do after step 7 for testing - no patch is applied yet.
> > 
> > After that step, I applied the patch and restarted everything.
> > 
> > Now when I access the ILL request I created, I get a 500 error - which I
> > assume is because of step 6 that credentials are required.
> 
> Hi David thank you for your time here. It appears I've had an incomplete
> test plan, apologies for that.
> I've updated the test plan, would you please take a look again when
> convenient? Thank you.

For step 8, I now get an error 500.

I'm not sure that I got the sequence right:
1. Step 7 - everything works as per the test plan
2. For step 8, I get an error 500. I applied the patch, restarted everything, then refreshed the page. Then I get a error 500 when I click 'Edit item metadata'. From the logs:

==> /var/log/koha/kohadev/plack-error.log <==
Template process failed: file error - /kohadevbox/koha/Koha/ILL/Backend/intra-includes/edititem.inc: not found at /kohadevbox/koha/C4/Templates.pm line 146.

==> /var/log/koha/kohadev/plack-intranet-error.log <==
[2025/06/16 05:36:00] [WARN] illrequestattributes is DEPRECATED in favor of extended_attributes at /var/lib/koha/kohadev/plugins/Koha/Plugin/Com/PTFSEurope/IncDocs.pm line 358.
Comment 10 Pedro Amorim 2025-06-16 09:17:44 UTC
Created attachment 183276 [details] [review]
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:
   <staff_url>/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.
Comment 11 Pedro Amorim 2025-06-16 09:17:46 UTC
Created attachment 183277 [details] [review]
Bug 40026: Update edit item metadata screen header
Comment 12 Pedro Amorim 2025-06-16 09:17:49 UTC
Created attachment 183278 [details] [review]
Bug 40026: 'Cancel' edit item metadata returns to request, not table view
Comment 13 Pedro Amorim 2025-06-16 09:19:01 UTC
(In reply to David Nind from comment #9)
> For step 8, I now get an error 500.

Thank you, David. Please try again. I had accidentally submitted a 24.11.x version of the patch but have corrected now.
Comment 14 David Nind 2025-06-16 10:15:53 UTC
(In reply to Pedro Amorim from comment #13)
> (In reply to David Nind from comment #9)
> > For step 8, I now get an error 500.
> 
> Thank you, David. Please try again. I had accidentally submitted a 24.11.x
> version of the patch but have corrected now.

Thanks Pedro!

When I edit the request in step 8, I get the standard form and the option to choose the type. 

Selecting any of the type options doesn't show any fields for the request type.

After clicking update, then "Edit item metadata" displays the fields for the previously selected type.

Selecting the type doesn't change the fields until you click update, then "Edit item metadata".

Not sure that I've explained this very well, or if this is what is expected.
Comment 15 Pedro Amorim 2025-06-16 11:17:33 UTC
(In reply to David Nind from comment #14)
> (In reply to Pedro Amorim from comment #13)
> > (In reply to David Nind from comment #9)
> > > For step 8, I now get an error 500.
> > 
> > Thank you, David. Please try again. I had accidentally submitted a 24.11.x
> > version of the patch but have corrected now.
> 
> Thanks Pedro!
> 
> When I edit the request in step 8, I get the standard form and the option to
> choose the type. 
> 
> Selecting any of the type options doesn't show any fields for the request
> type.
> 
> After clicking update, then "Edit item metadata" displays the fields for the
> previously selected type.
> 
> Selecting the type doesn't change the fields until you click update, then
> "Edit item metadata".
> 
> Not sure that I've explained this very well, or if this is what is expected.

That all seems to be as expected.
The bug you're describing (fields don't update) is a different one:
Bug 40025
Comment 16 David Nind 2025-06-16 21:05:17 UTC
Created attachment 183289 [details] [review]
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:
   <staff_url>/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 <david@davidnind.com>
Comment 17 David Nind 2025-06-16 21:05:21 UTC
Created attachment 183290 [details] [review]
Bug 40026: Update edit item metadata screen header

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2025-06-16 21:05:24 UTC
Created attachment 183291 [details] [review]
Bug 40026: 'Cancel' edit item metadata returns to request, not table view

Signed-off-by: David Nind <david@davidnind.com>
Comment 19 David Nind 2025-06-16 21:34:50 UTC
(In reply to Pedro Amorim from comment #15)

> That all seems to be as expected.
> The bug you're describing (fields don't update) is a different one:
> Bug 40025

Thanks Pedro! Signed off.