Bug 40024 - Backends that don't support get_requested_partners capability show a '(0)' in status
Summary: Backends that don't support get_requested_partners capability show a '(0)' in...
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:31 UTC by Pedro Amorim
Modified: 2025-06-02 08:52 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement removes the '(0)' for the ILL request status field, where the ILL backend does not support the 'get_requested_partners' capability. (The method returns '0' if the backend does not implement the capability. The template checks for 'length', and length of '0' is '1'.)
Version(s) released in:
Circulation function:


Attachments
Bug 40024: Update requested_partners check (2.76 KB, patch)
2025-05-29 12:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40024: Update requested_partners check (2.81 KB, patch)
2025-06-01 20:29 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:31:02 UTC

    
Comment 1 Pedro Amorim 2025-05-29 12:31:40 UTC
Created attachment 182833 [details] [review]
Bug 40024: Update requested_partners check

Test plan, k-t-d, don't apply patch:
1) Enable ILLModule
2) Install a backend that does not provide the 'get_requested_partners' capability, 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) You should now be on the 'Manage request' page. Notice there's a '(0)' after the status 'New request'. This happens because '_backend_capability' method returns '0' if the backend does not implement the capability. The template checks for 'length', and length of '0' is '1'.
7) Apply patch. Refresh the 'Manage request' page. Notice the '(0)' is no longer shown.

Additional testing, ensure no regression is added:
1) Edit the only ILL partner present in k-t-d:
   <staff_url>/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=16
2) Add a 'primary email'. Click 'Save'.
3) Do the same but for a Standard request:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Add a type, a cardnumber '42' and any library. Click 'Make request'.
5) You should now be on the 'Manage request' page. Click 'Place request with partners'. Select the only one available 'FRL - Walker' and click 'Send email'.
6) Notice the status shows 'Requested from partners (<the_email_you_entered_in_step_2)'. This is the expected behavior and working as before.
Comment 2 David Nind 2025-06-01 20:29:37 UTC
Created attachment 182892 [details] [review]
Bug 40024: Update requested_partners check

Test plan, k-t-d, don't apply patch:
1) Enable ILLModule
2) Install a backend that does not provide the 'get_requested_partners' capability, 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) You should now be on the 'Manage request' page. Notice there's a '(0)' after the status 'New request'. This happens because '_backend_capability' method returns '0' if the backend does not implement the capability. The template checks for 'length', and length of '0' is '1'.
7) Apply patch. Refresh the 'Manage request' page. Notice the '(0)' is no longer shown.

Additional testing, ensure no regression is added:
1) Edit the only ILL partner present in k-t-d:
   <staff_url>/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=16
2) Add a 'primary email'. Click 'Save'.
3) Do the same but for a Standard request:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Add a type, a cardnumber '42' and any library. Click 'Make request'.
5) You should now be on the 'Manage request' page. Click 'Place request with partners'. Select the only one available 'FRL - Walker' and click 'Send email'.
6) Notice the status shows 'Requested from partners (<the_email_you_entered_in_step_2)'. This is the expected behavior and working as before.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-06-01 20:34:05 UTC
I've attempted a release note - please correct if I have got things wrong.
Comment 4 Pedro Amorim 2025-06-02 08:52:32 UTC
(In reply to David Nind from comment #3)
> I've attempted a release note - please correct if I have got things wrong.

I think it's perfect. Thanks a lot, David.