Bug 39875 - ILL - History check fails if unauthenticated request
Summary: ILL - History check fails if unauthenticated request
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Marcel de Rooy
URL:
Keywords: RM_priority
Depends on: 38441
Blocks:
  Show dependency treegraph
 
Reported: 2025-05-12 13:28 UTC by Pedro Amorim
Modified: 2025-07-01 21:18 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the ILL request history check (added in Koha 25.05 by bug 38441 - Allow for an ILL history check workflow stage). If there is no patron, or it is an unauthenticated request, then the check to see if the same request has been made is no longer performed (requires enbaling the ILLHistoryCheck system preference).
Version(s) released in:
25.11.00,25.05.01
Circulation function:


Attachments
Bug 39875: Add tests (1.62 KB, patch)
2025-05-12 13:33 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39875: Dont show history check (1.35 KB, patch)
2025-05-12 13:33 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39875: Add tests (1.67 KB, patch)
2025-05-12 14:33 UTC, David Nind
Details | Diff | Splinter Review
Bug 39875: Dont show history check (1.40 KB, patch)
2025-05-12 14:33 UTC, David Nind
Details | Diff | Splinter Review
Bug 39875: Add tests (1.72 KB, patch)
2025-05-12 14:41 UTC, Lin Wei
Details | Diff | Splinter Review
Bug 39875: Dont show history check (1.45 KB, patch)
2025-05-12 14:41 UTC, Lin Wei
Details | Diff | Splinter Review
Bug 39875: Add tests (1.72 KB, patch)
2025-05-30 13:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39875: Dont show history check (1.46 KB, patch)
2025-05-30 13:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39875: Add tests (1.82 KB, patch)
2025-06-06 07:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 39875: Dont show history check (1.55 KB, patch)
2025-06-06 07:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 39875: (QA follow-up): Correct historycheck ui_context (1.53 KB, patch)
2025-06-06 09:47 UTC, Pedro Amorim
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-12 13:28:39 UTC

    
Comment 1 Pedro Amorim 2025-05-12 13:33:33 UTC
Created attachment 182273 [details] [review]
Bug 39875: Add tests
Comment 2 Pedro Amorim 2025-05-12 13:33:35 UTC
Created attachment 182274 [details] [review]
Bug 39875: Dont show history check

Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.
Comment 3 David Nind 2025-05-12 14:33:05 UTC
Created attachment 182291 [details] [review]
Bug 39875: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-05-12 14:33:08 UTC
Created attachment 182292 [details] [review]
Bug 39875: Dont show history check

Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Lin Wei 2025-05-12 14:41:30 UTC
Created attachment 182295 [details] [review]
Bug 39875: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Comment 6 Lin Wei 2025-05-12 14:41:33 UTC
Created attachment 182296 [details] [review]
Bug 39875: Dont show history check

Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Comment 7 Marcel de Rooy 2025-05-30 07:30:24 UTC
 FAIL   Koha/ILL/Request/Workflow/HistoryCheck.pm
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl Koha/ILL/Request/Workflow/HistoryCheck.pm`

 FAIL   t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t`
Comment 8 Pedro Amorim 2025-05-30 13:12:21 UTC
Created attachment 182858 [details] [review]
Bug 39875: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Comment 9 Pedro Amorim 2025-05-30 13:12:24 UTC
Created attachment 182859 [details] [review]
Bug 39875: Dont show history check

Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Comment 10 Marcel de Rooy 2025-06-06 07:33:45 UTC
Created attachment 183051 [details] [review]
Bug 39875: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2025-06-06 07:33:47 UTC
Created attachment 183052 [details] [review]
Bug 39875: Dont show history check

Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Pedro Amorim 2025-06-06 09:47:55 UTC
Created attachment 183065 [details] [review]
Bug 39875: (QA follow-up): Correct historycheck ui_context

This ui_context is supposed to be opac, not staff.
For the purposes of these tests, this is not important, as the ui_context is
only needed for the template params and this is testing if the history check
stage is supposed to show or not.
Reckon this was a copy paste without consequences hence missed, but the code
is now semantically more correct.

prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
Comment 13 Lucas Gass (lukeg) 2025-06-06 15:43:51 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 14 Paul Derscheid 2025-06-22 21:47:00 UTC
Nice work everyone!

Pushed to 25.05.x for 25.05.03
Comment 15 David Nind 2025-07-01 21:18:16 UTC
Attempted a release note - please update it if I haven't got it right.