Bug 39777 - ILL History Check does not show in OPAC
Summary: ILL History Check does not show in OPAC
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 38441
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-29 15:32 UTC by Pedro Amorim
Modified: 2025-04-30 03:15 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the ILL history check tests. It also restores the ILL history check when creating an ILL request in the OPAC. If a potential duplicate request is made (for example the patron has already made a request using the same DOI, Pubmed ID, or ISBN), it now displays the request history check page (when the ILLHistoryCheck system preference is enabled).
Version(s) released in:
Circulation function:


Attachments
Bug 39777: Rollback tests (1.19 KB, patch)
2025-04-29 15:39 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39777: Use cardnumber OR authenticated user cardnumber (1.25 KB, patch)
2025-04-29 15:39 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39777: Use cardnumber OR authenticated user cardnumber (1.57 KB, patch)
2025-04-29 15:43 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39777: Rollback tests (1.24 KB, patch)
2025-04-30 03:07 UTC, David Nind
Details | Diff | Splinter Review
Bug 39777: Use cardnumber OR authenticated user cardnumber (1.62 KB, patch)
2025-04-30 03:07 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-04-29 15:32:47 UTC

    
Comment 1 Pedro Amorim 2025-04-29 15:34:29 UTC
I was wrong in this comment in bug 38441:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38441#c73

The test failing was in fact a new bug I was introduced, as the cardnumber does not exist for authenticated patrons on the OPAC.
Comment 2 Pedro Amorim 2025-04-29 15:39:45 UTC
Created attachment 181671 [details] [review]
Bug 39777: Rollback tests

These tests should test an authenticated patron, without the presence of a cardnumber in the metadata (as it is the case in the OPAC form)
This is also the reason why we mock_userenv right below this.
Comment 3 Pedro Amorim 2025-04-29 15:39:47 UTC Comment hidden (obsolete)
Comment 4 Pedro Amorim 2025-04-29 15:43:30 UTC
Created attachment 181674 [details] [review]
Bug 39777: Use cardnumber OR authenticated user cardnumber

Test plan:
1) Apply the 'rollback tests' patch to reinstate the testing of the behavior if a cardnumber is missing (and a user is authenticated)
2) Run tests (they should fail):
    prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
3) Apply this patch. Repeat 2) They should pass.

Test plan for UI:
1) Enable ILLModule and ILLHistoryCheck
2) Create a new ILL on OPAC, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Select type="journal", enter DOI = "123". Create.
4) Repeat steps 2 and 3. A history check screen should be displayed (it is not, before this patch).
Comment 5 David Nind 2025-04-30 03:07:13 UTC
Created attachment 181692 [details] [review]
Bug 39777: Rollback tests

These tests should test an authenticated patron, without the presence of a cardnumber in the metadata (as it is the case in the OPAC form)
This is also the reason why we mock_userenv right below this.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-04-30 03:07:16 UTC
Created attachment 181693 [details] [review]
Bug 39777: Use cardnumber OR authenticated user cardnumber

Test plan:
1) Apply the 'rollback tests' patch to reinstate the testing of the behavior if a cardnumber is missing (and a user is authenticated)
2) Run tests (they should fail):
    prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
3) Apply this patch. Repeat 2) They should pass.

Test plan for UI:
1) Enable ILLModule and ILLHistoryCheck
2) Create a new ILL on OPAC, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Select type="journal", enter DOI = "123". Create.
4) Repeat steps 2 and 3. A history check screen should be displayed (it is not, before this patch).

Signed-off-by: David Nind <david@davidnind.com>