Bug 7371 - AutoEmailPrimaryAddress set to 'OFF' in new installs
Summary: AutoEmailPrimaryAddress set to 'OFF' in new installs
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: 3.6
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 16:34 UTC by Nicole C. Engard
Modified: 2013-12-05 20:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7371: Add 'cardnumber' as option for AutoEmailPrimaryAddress (1.28 KB, patch)
2012-04-12 05:56 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 7371: Add 'cardnumber' as option for AutoEmailPrimaryAddress (1.33 KB, patch)
2012-04-13 02:57 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2011-12-20 16:34:32 UTC
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoEmailPrimaryAddress','OFF','Defines the default email address where \'Account Details\' emails are sent.','email|emailpro|B_email|cardnumber|OFF','Choice');


This preference should be set to one of the choices - and OFF shouldn't be a choice - OFF seems to map to 'alternate'
Comment 1 Nicole C. Engard 2011-12-20 16:44:28 UTC
Also, doesn't first_valid make the most sense as the default value since it's the most broad?
Comment 2 Katrin Fischer 2012-04-12 05:50:22 UTC
Hi Nicole, 

I checked this bug and it seems that OFF is mapping to 'first valid' which makes the default setting like you wanted it :)

     -
         - "Use"
         - pref: AutoEmailPrimaryAddress
           default: "OFF"
           choices:
               email: home
               emailpro: work
               B_email: alternate
               "OFF": first valid
         - "patron email address for sending out emails."
     -

This also matches the code:
 909         if ($which_address eq 'OFF') {
 910             $to_address = GetFirstValidEmailAddress( $message->{'borrowernumber'} );

But there is one option 'cardnumber' that is not reflected in the pref file and can not be selected. I am going to add it.

INSERT INTO `systempreferences` VALUES ('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where Account Details emails are sent.','Choice')"
Comment 3 Katrin Fischer 2012-04-12 05:56:28 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2012-04-13 02:57:57 UTC
Created attachment 9162 [details] [review]
Bug 7371: Add 'cardnumber' as option for AutoEmailPrimaryAddress

The systempref.sql file had one more option 'cardnumber' that was not
visible from the system preference editor. This patch adds the setting.

To test:
- Check new setting cardnumber is available for AutoEmailPrimaryAddress
- Use setting with a patron that has an email address as cardnumber and
verify email is sent out correctly.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 5 Ian Walls 2012-04-13 17:29:28 UTC
Safely adds 'cardnumber' option to syspref editor.  Marking Passed QA.
Comment 6 Jared Camins-Esakov 2012-12-31 00:53:44 UTC
There have been no further reports of problems so I am marking this bug resolved.