]> git.koha-community.org Git - koha.git/commit
Bug 37757: Make notice_email_address() handle EmailFieldPrimary values more robustly
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 28 Aug 2024 18:01:37 +0000 (15:01 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 13 Sep 2024 14:06:24 +0000 (16:06 +0200)
commitb262e350f121968c2340cbc5286a1f1ae6115a15
treedf90883f62efcd55aa998f98e91ff6960487aaff
parent79ffb8841b1f052a104b9a7605c46eeacbd1142a
Bug 37757: Make notice_email_address() handle EmailFieldPrimary values more robustly

This patchset makes:

* The EmailFieldPrimary value 'OFF' be replaced by an empty string
* Koha::Patron->notice_email_address() handle the empty case more
  gracefully

To test:
1. On main, manually set the EmailFieldPrimary syspref to empty
   $ ktd --shell
  k$ koha-mysql kohadev
   > UPDATE systempreferences SET value='' WHERE variable='EmailFieldPrimary';
2. Enable `AutoEmailNewUser`
3. Create a new user
=> FAIL: Koha explodes like:
```
The method Koha::Patron-> is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Object.pm line 992
Koha::Object::AUTOLOAD('Koha::Patron=HASH(0xaaaae37ac550)') called at /kohadevbox/koha/Koha/Patron.pm line 1662
Koha::Patron::notice_email_address('Koha::Patron=HASH(0xaaaae37ac550)') called at /kohadevbox/koha/members/memberentry.pl line 448
...

4. Apply this patches
5. Run:
  k$ updatedatabase
=> SUCCESS: Update succeeds
6. Restart all and retry creating a patron
=> SUCCESS: It worked!
7. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/Patron.pm