Bugzilla – Attachment 181606 Details for
Bug 38441
Allow for an ILL history check workflow stage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38441: (QA follow-up): Only look for matchin requests if patron
Bug-38441-QA-follow-up-Only-look-for-matchin-reque.patch (text/plain), 2.34 KB, created by
Pedro Amorim
on 2025-04-28 12:17:09 UTC
(
hide
)
Description:
Bug 38441: (QA follow-up): Only look for matchin requests if patron
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-04-28 12:17:09 UTC
Size:
2.34 KB
patch
obsolete
>From 38708ffc8006e7f6c8aeb6829cddd1f6e1d6c86b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 17 Apr 2025 13:05:16 +0000 >Subject: [PATCH] Bug 38441: (QA follow-up): Only look for matchin requests if > patron > >Previous commit 'HistoryCheck now only considers same patron' added the following regression: >HistoryCheck is performed and shown in the OPAC even if no user is authenticated (using ILLOpacUnauthenticatedRequest). >This fixes that. History check is skipped unless a user exists. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/ILL/Request/Workflow/HistoryCheck.pm | 4 +++- > t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t | 8 +++++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/Koha/ILL/Request/Workflow/HistoryCheck.pm b/Koha/ILL/Request/Workflow/HistoryCheck.pm >index 5a3eefbddf4..818f2f4c742 100644 >--- a/Koha/ILL/Request/Workflow/HistoryCheck.pm >+++ b/Koha/ILL/Request/Workflow/HistoryCheck.pm >@@ -195,8 +195,10 @@ sub _find_matching_requests { > > my $patron = Koha::Patrons->find( { cardnumber => $self->{metadata}->{cardnumber} } ); > >+ return 0 unless $patron; >+ > my $query; >- $query->{'-and'} = [ { 'me.borrowernumber' => $patron->borrowernumber } ] if $patron; >+ $query->{'-and'} = [ { 'me.borrowernumber' => $patron->borrowernumber } ]; > foreach my $id_field (@existing_id_fields) { > push @{ $query->{'-or'} }, { > 'illrequestattributes.type' => $id_field, >diff --git a/t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t b/t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t >index e1f7a3a2fef..873ea4c30b1 100755 >--- a/t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t >+++ b/t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t >@@ -126,14 +126,16 @@ subtest 'after_request_created' => sub { > > my $fake_cardnumber = '123456789'; > my $metadata = { >- title => 'This is a title', >- author => 'This is an author', >- isbn => $isbn >+ title => 'This is a title', >+ author => 'This is an author', >+ isbn => $isbn, >+ cardnumber => $fake_cardnumber, > }; > > my $authenticated_patron = $builder->build_object( > { > class => 'Koha::Patrons', >+ value => { cardnumber => $fake_cardnumber } > } > ); > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38441
:
174604
|
174605
|
174606
|
174607
|
174608
|
174609
|
174610
|
174611
|
175300
|
175301
|
175302
|
175303
|
175304
|
175305
|
175306
|
175307
|
176507
|
176508
|
176509
|
176510
|
176511
|
176512
|
176513
|
176514
|
176561
|
176566
|
176573
|
176829
|
179800
|
179801
|
179802
|
179803
|
179804
|
179805
|
179806
|
179807
|
179808
|
179809
|
179810
|
179811
|
180034
|
180035
|
180036
|
180037
|
180038
|
180039
|
180040
|
180041
|
180042
|
180043
|
180044
|
180045
|
180907
|
180908
|
180909
|
180910
|
180911
|
180912
|
180913
|
180914
|
180915
|
180916
|
180917
|
180918
|
180919
|
181072
|
181111
|
181112
|
181113
|
181114
|
181115
|
181116
|
181117
|
181118
|
181119
|
181120
|
181121
|
181122
|
181123
|
181124
|
181125
|
181126
|
181593
|
181594
|
181595
|
181596
|
181597
|
181598
|
181599
|
181600
|
181601
|
181602
|
181603
|
181604
|
181605
| 181606 |
181607