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 <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomas Cohen Arazi 2021-10-06 09:01:13 -03:00 committed by Jonathan Druart
parent b356ad25de
commit 707e68b7fc
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}