Bugzilla – Attachment 190770 Details for
Bug 39014
Storing a guarantee fails due to TrackLastPatronActivityTriggers "creating a patron"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39014: (QA follow-up) Fix tidiness
Bug-39014-QA-follow-up-Fix-tidiness.patch (text/plain), 5.40 KB, created by
Lari Taskula
on 2025-12-29 18:42:14 UTC
(
hide
)
Description:
Bug 39014: (QA follow-up) Fix tidiness
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-12-29 18:42:14 UTC
Size:
5.40 KB
patch
obsolete
>From 666a20ee1acd9f5755e31478b1b4da400d1e3a2c Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Mon, 29 Dec 2025 20:05:55 +0200 >Subject: [PATCH] Bug 39014: (QA follow-up) Fix tidiness > >--- > Koha/Exceptions/Patron/Relationship.pm | 5 ++++- > .../prog/en/modules/members/memberentrygen.tt | 9 ++++++--- > members/memberentry.pl | 7 ++++--- > t/db_dependent/Koha/Patron.t | 4 ++-- > 4 files changed, 16 insertions(+), 9 deletions(-) > >diff --git a/Koha/Exceptions/Patron/Relationship.pm b/Koha/Exceptions/Patron/Relationship.pm >index 000e95d1097..768d5a1b0fb 100644 >--- a/Koha/Exceptions/Patron/Relationship.pm >+++ b/Koha/Exceptions/Patron/Relationship.pm >@@ -32,7 +32,10 @@ use Exception::Class ( > 'Koha::Exceptions::Patron::Relationship::InvalidRelationship' => { > isa => 'Koha::Exceptions::Patron::Relationship', > description => 'The specified relationship is invalid', >- fields => [ 'relationship', 'no_relationship', 'invalid_guarantor', 'child_guarantor', 'guarantor_cant_have_guarantors', 'guarantor' ], >+ fields => [ >+ 'relationship', 'no_relationship', 'invalid_guarantor', 'child_guarantor', >+ 'guarantor_cant_have_guarantors', 'guarantor' >+ ], > }, > 'Koha::Exceptions::Patron::Relationship::NoGuarantor' => { > isa => 'Koha::Exceptions::Patron::Relationship', >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 140c3fe984b..9e8bf04c0b7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -196,9 +196,12 @@ > [% END %] > [% IF ( ERROR_guarantor_is_guarantee ) %] > <li id="ERROR_guarantor_is_guarantee"> >- Cannot add a guarantor. The proposed guarantor <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor_is_guarantee.borrowernumber | uri %]" target="blank"> >- [% guarantor_is_guarantee.firstname | html %] [% guarantor_is_guarantee.surname | html %] ([% guarantor_is_guarantee.cardnumber | html %]) >- </a> is a guarantee of someone else, and guarantees cannot be guarantors.</li> >+ Cannot add a guarantor. The proposed guarantor >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor_is_guarantee.borrowernumber | uri %]" target="blank"> >+ [% guarantor_is_guarantee.firstname | html %] [% guarantor_is_guarantee.surname | html %] ([% guarantor_is_guarantee.cardnumber | html %]) >+ </a> >+ is a guarantee of someone else, and guarantees cannot be guarantors.</li >+ > > [% END %] > [% IF ( ERROR_guarantor_cant_have_guarantors ) %] > <li id="ERROR_guarantor_cant_have_guarantors">Cannot add a guarantor. This patron is already a guarantor, and guarantors cannot have guarantors.</li> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 1f88cceff31..ec02bec7d16 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -23,7 +23,7 @@ use Modern::Perl; > use Try::Tiny; > > # external modules >-use CGI qw ( -utf8 ); >+use CGI qw ( -utf8 ); > use Scalar::Util qw( blessed ); > > # internal modules >@@ -53,8 +53,8 @@ use Koha::SMS::Providers; > my $input = CGI->new; > my %data; > >-my $dbh = C4::Context->dbh; >-my $logger = Koha::Logger->get({ interface => 'intranet '}); >+my $dbh = C4::Context->dbh; >+my $logger = Koha::Logger->get( { interface => 'intranet ' } ); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -298,6 +298,7 @@ if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && $guarantors_to_be_validated > if ( $patron->categorycode eq $categorycode ) { > $patron->can_be_guaranteed_by($guarantors_to_be_validated); > } else { >+ > # If $patron's categorycode is about to change, check guarantor requirements against > # the new category but keep the original $patron object intact > # (this clone()s the $patron) >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 1b016ecf687..44802ce4ba1 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -2687,8 +2687,8 @@ subtest 'can_be_guaranteed_by() tests' => sub { > 'Exception thrown when child patron is added as guarantor.'; > > t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' ); >- $child2->add_guarantor({ guarantor_id => $patron->id, relationship => 'parent' }); >- @guarantors = ( $patron2 ); >+ $child2->add_guarantor( { guarantor_id => $patron->id, relationship => 'parent' } ); >+ @guarantors = ($patron2); > throws_ok { $patron->can_be_guaranteed_by( \@guarantors ); } > 'Koha::Exceptions::Patron::Relationship::InvalidRelationship', > 'Exception thrown when trying to add a guarantor to a guarantor.'; >-- >2.34.1
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 39014
:
177563
|
177564
|
177619
|
178546
|
178547
|
179572
|
180298
|
182290
|
188041
|
188461
|
188462
|
188463
|
188464
|
190493
|
190494
|
190767
|
190768
|
190769
|
190770
|
190772
|
190773
|
191014