Bug 24263: Replace borrowers.relationship with NULL when was empty string
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 18 Dec 2019 13:04:58 +0000 (14:04 +0100)
committerJoy Nelson <joy@bywatersolutions.com>
Sat, 18 Jan 2020 15:34:55 +0000 (15:34 +0000)
commitfb20bea31e0bba7c863077493be167db18b2ed83
tree79af1db6517790bc9797febd31156ddb80f02ad2
parentd6f660e4f07a7bc5bec117d4701dfb35ef1a771d
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Koha/Patron.pm