Custom Profile Fields - Date error OpenEMM5.5.1 ... fixed

Questions and answers on bugs and upcoming versions of OpenEMM. See also OpenEMM bugtracker at SourceForge: http://sourceforge.net/tracker/?atid=84 ... unc=browse

Moderator: moderator

Custom Profile Fields - Date error OpenEMM5.5.1 ... fixed

Postby kauffmtj » Wed Oct 14, 2009 5:33 pm

I created a date field in settings/edit profile fields. I used type 'Date'. On page 177 of the manual, I eventually found the note which said that to set values in this date, I need 3 fields in my form: fieldname_DAY_DATE, fieldname_MONTH_DATE, and fieldname_YEAR_DATE. (my field is named next_alert)

HOWEVER ...

Once I tried using this form, I started getting the error page instead of the confirmation page ... with no real details. I found that a second submission always worked, and the recipient was added to the database, but with no mailings subscribed/checked.

Troubleshooting:

I found a log file on the server, under /home/openemm/var/log, called core_stdout.log. (I didn't find anything useful in core_stderr.log.)

I found an entry where RecipientDaoImpl was adding new customer, and my date field was being entered as STR_TO_DATE('14.04.2010' 00:00:00', '%d.%m.%Y %H:%i:%s'). Shortly thereafter, I see a message: SQL State [01004] Error code [0]; data truncation: Data truncated for column 'next_alert' at row 1 .... etc.

Solution:

I eventually investigated the MySQL database, database: openmm, table customer_1_tbl. I found that the built-in fields, creation_date and change_date were type timestamp. But my custom field, next_alert, was type date.

Apparently, a date field can't hold the time values being provided in the code. Since I can't rewrite the code, I revised the database. For my field next_alert, I did:

alter table customer_1_tbl change colulmn next_alert next_alert TIMESTAMP;

That did it. No more error pages.

Suggestion: The system should be changed to declare these custom date fields as timestamp instead of date. Alternatively, fix the insert process to avoid trying to stuff time values into a field that can't hold them.
kauffmtj
 
Posts: 1
Joined: Wed Oct 14, 2009 5:15 pm

Postby maschoff » Sat Oct 24, 2009 9:52 am

Thanks for the info, we will look into this issue.
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 1310
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Postby maschoff » Thu Oct 29, 2009 10:06 am

Actually, the problem runs even deeper. I posted a bug report at the SourceForge bugtracker here:

https://sourceforge.net/tracker/?func=d ... tid=848488

We wil try to fix it for relase 6.RC2 (scheduled for next week).
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 1310
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany


Return to Bugs, bug fixes & releases

Who is online

Users browsing this forum: No registered users and 0 guests

cron