From 84acee417630ed778025d38a8b606476387fee47 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 23 Feb 2018 12:55:33 -0300 Subject: [PATCH] Bug 20287: Fix test t/db_dependent/Members.t and prevent regressions Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- Koha/Patron.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index ca07ad80b2..3b0d804add 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -256,6 +256,13 @@ sub store { $self->dateenrolled(undef) unless $self->dateenrolled; $self->dateexpiry(undef) unless $self->dateexpiry; + # FIXME We should not deal with that here, callers have to do this job + # Moved from ModMember to prevent regressions + unless ( $self->userid ) { + my $stored_userid = $self->get_from_storage->userid; + $self->userid($stored_userid); + } + if ( C4::Context->preference('FeeOnChangePatronCategory') and $self->category->categorycode ne $self->get_from_storage->category->categorycode ) -- 2.39.5