Bugzilla – Attachment 96991 Details for
Bug 24263
borrowers.relationship should not contain an empty string
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24263: Replace borrowers.relationship with NULL when was empty string
Bug-24263-Replace-borrowersrelationship-with-NULL-.patch (text/plain), 1.77 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-08 13:12:45 UTC
(
hide
)
Description:
Bug 24263: Replace borrowers.relationship with NULL when was empty string
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-08 13:12:45 UTC
Size:
1.77 KB
patch
obsolete
>From f34fdafae0ecfb62901115783e181c51771599d2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Dec 2019 14:04:58 +0100 >Subject: [PATCH] Bug 24263: Replace borrowers.relationship with NULL when was > empty string > >When you create a new patron, its relationship field is populated with >an empty string when we are expecting NULL. > >Otherwise the about page will display a warning about a missing/wrong >relationship in data (that is not in the syspref) > >Test plan: >0/ Do not apply the patches from this bug report >1/ Create a new patron (child) >2/ Notice that relationship column in DB is set to an empty string >3/ Go to the about page, notice the invalid warning about relationship >values not in the syspref >4/ Apply DB changes and tests >5/ Execute the update DB entry >=> The value in DB is now NULL when was "" >6/ Execute the tests >=> It fails >7/ Apply the last patch >8/ Add and edit a patron (child) >=> relationship is set to NULL in DB >9/ Execute the tests >=> They pass! > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Patron.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 27e552a48c..a3ebfc9b2e 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -199,6 +199,10 @@ sub store { > $self->surname( uc($self->surname) ) > if C4::Context->preference("uppercasesurnames"); > >+ $self->relationship(undef) # We do not want to store an empty string in this field >+ if defined $self->relationship >+ and $self->relationship eq ""; >+ > unless ( $self->in_storage ) { #AddMember > > # Generate a valid userid/login if needed >-- >2.24.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 24263
:
96418
|
96419
|
96420
|
96531
|
96532
|
96533
|
96989
|
96990
| 96991 |
96992