From 09d6274c029f2e47f34919c40bdc15ae598e78b7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 6 Oct 2021 09:01:13 -0300 Subject: [PATCH] Bug 29182: Make sure methods call the overloaded ->store This patch addresses the issue of `request()` and `set_pending()` calling $self->SUPER::store instead of the overloaded one. This prevents created_on being set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/ArticleRequest.t => FAIL: created_on is not set on two methods 3. Apply this patch 4. Repeat 2 => SUCCESS: created_on is now set! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- Koha/ArticleRequest.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index e03af23173..2d7f5596da 100644 --- a/Koha/ArticleRequest.pm +++ b/Koha/ArticleRequest.pm @@ -57,7 +57,7 @@ sub request { ) unless $self->borrower->can_request_article; $self->status(Koha::ArticleRequest::Status::Requested); - $self->SUPER::store(); + $self->store(); $self->notify(); return $self; } @@ -74,7 +74,7 @@ sub set_pending { my ($self) = @_; $self->status(Koha::ArticleRequest::Status::Pending); - $self->SUPER::store(); + $self->store(); $self->notify(); return $self; } @@ -204,7 +204,7 @@ sub store { return $self->SUPER::store; } else { $self->created_on( dt_from_string() ); - return $self->request; + return $self->SUPER::store; } } -- 2.20.1