Bug 24464: (QA follow-up) Make the method reflect the lack of FK
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 20 Mar 2020 18:53:35 +0000 (15:53 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 08:06:37 +0000 (08:06 +0000)
This patch makes it super obvious to understand by reading the code that
there's originally no foreign key.

To test:
1. Run the tests and notice they pass
2. Spot the # FIXME
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Acquisition/Basket.pm

index 4d9a87c..65d9e16 100644 (file)
@@ -57,8 +57,9 @@ Returns the I<Koha::Patron> for the basket creator.
 
 sub creator {
     my ($self) = @_;
-    return Koha::Patrons->find( $self->authorisedby )
-        if $self->authorisedby;
+    my $borrowernumber = $self->authorisedby; # FIXME missing FK here
+    return unless $borrowernumber;
+    return Koha::Patrons->find( $borrowernumber );
 }
 
 =head3 basket_group