5 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 14   (RSS)

By nmsinc - June 7 - edited: June 7

Is there a way to force the saving of the 'createdDate' field when uploading in CVS 1.13?

Thanks - nmsinc

Hi Damon,

Just needed to know why the createdDate does not populate with the current date of import for each file that is imported from CVS!

Thanks - NMS

Hi nmsinc, 

There's no particular reason, it's just never come up before and it's one of those edge behaviours where it's not entirely clear that one behaviour would be obvious and expected in all scenarios.  createdDate is set through the application, not through MySQL, so it doesn't happen automatically.  Some of the edge cases would be what to do when a user is importing createdDate but it's blank, etc.  In general, importCSV doesn't automatically set any values except what is being imported.

If you need that functionality you could try creating a TIMESTAMP field and setting it's default value in the mysql schema.  See: https://dba.stackexchange.com/questions/132951/cant-default-date-to-current-timestamp-in-mysql-5-5  

Note that I haven't tested that.  Another option would be to modify the plugin or write some custom code.  

Hope that helps, let me know any questions!

Dave Edis - Senior Developer

Thanks Dave - appreciate the feedback. I will try some custom code in the plugin!