Bugzilla – Attachment 80846 Details for
Bug 21596
Handle default values when storing Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21596: Handle empty string for other attributes when storing a patron
Bug-21596-Handle-empty-string-for-other-attributes.patch (text/plain), 1.95 KB, created by
Martin Renvoize (ashimema)
on 2018-10-18 13:53:05 UTC
(
hide
)
Description:
Bug 21596: Handle empty string for other attributes when storing a patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-18 13:53:05 UTC
Size:
1.95 KB
patch
obsolete
>From 31ba7a454b9d3547f97a8562cd25faf3eeb604c1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 Oct 2018 20:01:47 -0300 >Subject: [PATCH] Bug 21596: Handle empty string for other attributes when > storing a patron > >lastseen, updated_on => dates >gonenoaddress, login_attempts, privacy_guarantor_checkouts => [tiny]int > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Patron.pm | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 523f745a86..fb3f8684a5 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -193,9 +193,11 @@ sub store { > $self->trim_whitespaces; > > # We don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00) >- $self->dateofbirth(undef) unless $self->dateofbirth; >- $self->debarred(undef) unless $self->debarred; >+ $self->dateofbirth(undef) unless $self->dateofbirth; >+ $self->debarred(undef) unless $self->debarred; > $self->date_renewed(undef) unless $self->date_renewed; >+ $self->lastseen(undef) unless $self->lastseen; >+ $self->updated_on(undef) unless $self->updated_on; > > # Set default values if not set > $self->sms_provider_id(undef) unless $self->sms_provider_id; >@@ -204,6 +206,11 @@ sub store { > # If flags == 0 or flags == '' => no permission > $self->flags(undef) unless $self->flags; > >+ # tinyint or int >+ $self->gonenoaddress(0) unless $self->gonenoaddress; >+ $self->login_attempts(0) unless $self->login_attempts; >+ $self->privacy_guarantor_checkouts(0) unless $self->privacy_guarantor_checkouts; >+ > unless ( $self->in_storage ) { #AddMember > > # Generate a valid userid/login if needed >-- >2.19.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21596
:
80804
|
80807
|
80808
|
80809
|
80810
|
80837
|
80838
|
80839
|
80840
|
80844
|
80845
| 80846 |
80847
|
81080
|
81160
|
81537