From 277973e209c4b15481a9f850567099d035561289 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 Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 5eaee314c59a4ed8f3d75c7897f931f57f1577b1) Signed-off-by: Matt Blenkinsop --- 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 c7cfb941a6..cf10c2582d 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 88ede2cc51..544f4aaa0c 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.39.5