Bugzilla – Attachment 95411 Details for
Bug 12446
Enable an adult to have a guarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12446: (follow-up) Update for Bug 17168
Bug-12446-follow-up-Update-for-Bug-17168.patch (text/plain), 3.59 KB, created by
Maryse Simard
on 2019-11-13 21:11:03 UTC
(
hide
)
Description:
Bug 12446: (follow-up) Update for Bug 17168
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-11-13 21:11:03 UTC
Size:
3.59 KB
patch
obsolete
>From 91adee986d6225cc31c2fdf6e1eda043a6af47ec Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Wed, 13 Nov 2019 16:06:58 -0500 >Subject: [PATCH] Bug 12446: (follow-up) Update for Bug 17168 > >--- > Koha/Patron.pm | 3 +-- > t/db_dependent/Patrons.t | 9 +++++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 8e501fc..3fadf06 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -287,8 +287,7 @@ sub store { > > # Clean up guarantors on category change if required > $self->guarantor_relationships->delete >- if ( $self->category->category_type ne 'C' >- && $self->category->category_type ne 'P' ); >+ unless ( $self->category->canbeguarantee ); > > } > >diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t >index b11a9d3..aeb7c74 100755 >--- a/t/db_dependent/Patrons.t >+++ b/t/db_dependent/Patrons.t >@@ -106,19 +106,22 @@ foreach my $b ( $patrons->as_list() ) { > } > > subtest "Update patron categories" => sub { >- plan tests => 19; >+ plan tests => 21; > t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); > my $c_categorycode = $builder->build({ source => 'Category', value => { > category_type=>'C', > upperagelimit=>17, > dateofbirthrequired=>5, >+ canbeguarantee=>1, > } })->{categorycode}; > my $c_categorycode_2 = $builder->build({ source => 'Category', value => { > category_type=>'C', > upperagelimit=>17, > dateofbirthrequired=>5, >+ canbeguarantee=>1, > } })->{categorycode}; >- my $a_categorycode = $builder->build({ source => 'Category', value => {category_type=>'A'} })->{categorycode}; >+ my $a_categorycode = $builder->build({ source => 'Category', value => {category_type=>'A', canbeguarantee=>0} })->{categorycode}; >+ my $a_categorycode_2 = $builder->build({ source => 'Category', value => {category_type=>'A', canbeguarantee=>1} })->{categorycode}; > my $p_categorycode = $builder->build({ source => 'Category', value => {category_type=>'P'} })->{categorycode}; > my $i_categorycode = $builder->build({ source => 'Category', value => {category_type=>'I'} })->{categorycode}; > my $branchcode1 = $builder->build({ source => 'Branch' })->{branchcode}; >@@ -188,6 +191,8 @@ subtest "Update patron categories" => sub { > is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantees not removed when made changing child categories'); > is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); > is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult'); >+ is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2})->update_category_to({category=>$a_categorycode_2}),2,'Two child patrons updated to adult category'); >+ is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantees were not removed when made adult which can be guarantee'); > > is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees'); > is( Koha::Patrons->search_patrons_to_update_category({from=>$p_categorycode})->update_category_to({category=>$a_categorycode}),1,'One professional patron updated to adult category'); >-- >2.7.4
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 12446
:
29278
|
36176
|
39744
|
42469
|
42470
|
42535
|
46277
|
46278
|
46327
|
46328
|
46345
|
46486
|
49793
|
50953
|
53534
|
53535
|
53536
|
53913
|
60929
|
60930
|
60934
|
63148
|
63149
|
63214
|
64793
|
64794
|
64828
|
72295
|
72883
|
77766
|
77767
|
77768
|
79343
|
79344
|
79345
|
79347
|
79348
|
85069
|
88364
|
88365
|
88366
|
88367
|
90389
|
90390
|
90391
|
90392
|
90470
|
90471
|
90472
|
90473
|
93388
|
93389
|
93390
|
93391
|
93392
|
93393
|
93394
|
95411
|
95853
|
95854
|
95855
|
95856
|
95857
|
95858
|
95859
|
95860
|
106753
|
106754
|
106755
|
106756
|
106757
|
107611
|
111052
|
111053
|
111317
|
111318
|
112102
|
112160
|
112161
|
112162
|
112163
|
113583
|
121925
|
121926
|
121927
|
121928
|
121929
|
122084
|
122085
|
122086
|
122087
|
122088
|
122089
|
122090
|
122091
|
122184
|
122185
|
122186
|
122187
|
130398
|
130399
|
130400
|
130401
|
130402
|
131965
|
131966
|
131967
|
131968
|
131969
|
133691
|
133952
|
133953
|
133954
|
133955
|
133956
|
133957
|
134930
|
134931
|
134932
|
134933
|
134934
|
134935
|
134936
|
135506
|
135507
|
135508
|
135509
|
135510
|
135511
|
135512
|
135519
|
135520
|
135521
|
135522
|
135523
|
135544
|
135545
|
142401
|
142408
|
142431
|
142432
|
142433
|
142434
|
142435
|
142436
|
142437
|
142438
|
142439