Bugzilla – Attachment 188923 Details for
Bug 40517
Allow grouping existing holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40517: (QA follow-up): Fix tests
Bug-40517-QA-follow-up-Fix-tests.patch (text/plain), 2.19 KB, created by
Pedro Amorim
on 2025-11-03 10:44:16 UTC
(
hide
)
Description:
Bug 40517: (QA follow-up): Fix tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-11-03 10:44:16 UTC
Size:
2.19 KB
patch
obsolete
>From d5ae4ad722435fbf71fa5db6cbf83ce3a83e6641 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Mon, 3 Nov 2025 10:43:44 +0000 >Subject: [PATCH] Bug 40517: (QA follow-up): Fix tests > >Enforce no hold group when creating hold object > >When a hold is created by build_object, it's auto-assigned a hold_group_id (as expected). >When a hold is ->fill, it's hold_group_id is cleared by cleanup_hold_group (as expected). > >The problem is then this causes the object before ->fill to be out of sync with the up to date object returned by the API (i.e. the latter has an empty hold_group_id, as expected, but the former has the auto-assigned hold_group_id). > >Using ->discard_changes or ->get_from_storage doesnt work because the became a after ->fill. >--- > t/db_dependent/api/v1/patrons_holds.t | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/api/v1/patrons_holds.t b/t/db_dependent/api/v1/patrons_holds.t >index 67cd30b4d32..78f995488c6 100755 >--- a/t/db_dependent/api/v1/patrons_holds.t >+++ b/t/db_dependent/api/v1/patrons_holds.t >@@ -53,9 +53,12 @@ subtest 'list() tests' => sub { > $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/holds' )->status_is( 200, 'REST3.2.2' ) > ->json_is( [] ); > >- my $hold_1 = $builder->build_object( { class => 'Koha::Holds', value => { borrowernumber => $patron->id } } ); >- my $hold_2 = $builder->build_object( { class => 'Koha::Holds', value => { borrowernumber => $patron->id } } ); >- my $hold_3 = $builder->build_object( { class => 'Koha::Holds', value => { borrowernumber => $patron->id } } ); >+ my $hold_1 = $builder->build_object( >+ { class => 'Koha::Holds', value => { hold_group_id => undef, borrowernumber => $patron->id } } ); >+ my $hold_2 = $builder->build_object( >+ { class => 'Koha::Holds', value => { hold_group_id => undef, borrowernumber => $patron->id } } ); >+ my $hold_3 = $builder->build_object( >+ { class => 'Koha::Holds', value => { hold_group_id => undef, borrowernumber => $patron->id } } ); > > $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/holds?_order_by=+me.hold_id' ) > ->status_is( 200, 'REST3.2.2' ) >-- >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 40517
:
184640
|
184641
|
184642
|
184643
|
184644
|
184645
|
184646
|
184729
|
184732
|
184733
|
184734
|
184735
|
184736
|
184737
|
184738
|
184739
|
185217
|
186672
|
186673
|
186674
|
186675
|
186676
|
186677
|
186678
|
186679
|
186680
|
186745
|
186746
|
186747
|
186748
|
186749
|
186750
|
186751
|
186752
|
186753
|
187789
|
187790
|
187791
|
187792
|
187793
|
187794
|
187795
|
187796
|
187797
|
187801
|
187802
|
187803
|
187804
|
187805
|
187806
|
187807
|
187808
|
187809
|
187810
|
187811
|
187812
|
187965
|
187966
|
187967
|
187968
|
187969
|
187970
|
187971
|
187972
|
187973
|
187974
|
187975
|
187976
|
188293
|
188294
|
188343
|
188422
| 188923