Bug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 28 Aug 2015 07:13:09 +0000 (09:13 +0200)
committerChris Cormack <chris@bigballofwax.co.nz>
Tue, 22 Sep 2015 16:59:30 +0000 (04:59 +1200)
commitbc720464216eca9d5283596af23d2c2c926e7093
tree0c8bfd2ca0e80e303f202991381cdcbab1860433
parent227d7b950e682300a7697ada4f6837a950f098e6
Bug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber

This is an issue discussed on older reports already in the past.
Column mobile in borrowers is actually 'Other phone', not necessary a
mobile number. The name of the field is confusing. (Renaming it is
outside the scope of this report.)
The field that we are editing here is smsalertnumber. It should not be
compared with mobile at all.

What could be the side-effect of this correction?
===
First, the change is only relevant for libraries with pref SMSSendDriver
enabled.
In the past patrons editing their message preferences saw mobile (read:
other phone) in their smsalertnumber field (if the latter was still empty).
If they saved it, it was copied to smsalertnumber.
This change does not affect these patrons. They just have the same number
in two columns. No big deal.
What if a patron does not yet have a smsalertnumber? In that case no sms
is sent in Letters.pm. So no change in behavior. If he submits
opac-messaging now, he will no longer copy his other phone to smsalert [we
cannot assume that it was mobile anyway!]. If he enters a mobile number,
it will be saved correctly in the right field.

Conclusion: this change will not break things or hurt anyone. It only
prevents unwanted copying other phone to smsalertnumber.

Also modified the compare to prevent uninitialized warnings.
And removed a commented warn.

Test plan:
[1] Add, edit or delete the SMS number on opac-messaging regardless of
    the value of Other Phone (in the badly named mobile field).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b8d7168beb27342c4c483a0812e3a6789fabced)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
opac/opac-messaging.pl