From 800c9305244bc79092b8893a28c2972801b580df Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 4 May 2023 07:06:07 +0000 Subject: [PATCH] Bug 33671: Update POD, remove unneeded check in relationship->guarantor [1] Update POD for $patron->guarantor_relationships [2] Remove check from Patron::Relationship->guarantor Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Patron/Relationships.t Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/Patron.pm | 6 +++--- Koha/Patron/Relationship.pm | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index f0e17342171..d7c2d47b429 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -471,9 +471,9 @@ Returns Koha::Patron::Relationships object for this patron's guarantors Returns the set of relationships for the patrons that are guarantors for this patron. -This is returned instead of a Koha::Patron object because the guarantor -may not exist as a patron in Koha. If this is true, the guarantors name -exists in the Koha::Patron::Relationship object and will have no guarantor_id. +Note that a guarantor should exist as a patron in Koha; it was not possible +to add them without a guarantor_id in the interface for some time. Bug 30472 +restricts it on db level. =cut diff --git a/Koha/Patron/Relationship.pm b/Koha/Patron/Relationship.pm index 88ede2cc519..544f4aaa0c7 100644 --- a/Koha/Patron/Relationship.pm +++ b/Koha/Patron/Relationship.pm @@ -73,15 +73,12 @@ sub store { =head3 guarantor -Returns the Koha::Patron object for the guarantor, if there is one +Returns the Koha::Patron object for the guarantor =cut sub guarantor { my ( $self ) = @_; - - return unless $self->guarantor_id; - return Koha::Patrons->find( $self->guarantor_id ); } @@ -93,7 +90,6 @@ Returns the Koha::Patron object for the guarantee sub guarantee { my ( $self ) = @_; - return Koha::Patrons->find( $self->guarantee_id ); } -- 2.25.1