views:

512

answers:

2

I have a simple form built with the Webforms module in Drupal. The standard textfield form fields work perfectly. However if I use the preset date or time form values, they don't get emailed properly when the form is submitted.

For instance, if there was a date field in my form, it would submit fine and render on the results page just fine, but if I wanted that value to be included in an email, it would show up as "Array" within the text of the email instead of showing the date.

There is an open support issue within the module issues page, but I'm hoping for any additional help.

+1  A: 

I haven't tried webform, so there might be an issue or something. However, it sounds like you are adding an array of values to the mail instead of the actual value. If this is due to the wrong setup, or a bug in webform, I can't say.

googletorp
It seems to be a bug in the module itself.http://drupal.org/node/549102Frustrating.
Doc Falken
A: 

It is in fact an array - see http://drupal.org/node/448954 for info. In the case of date fields, the date parts are in a numbered array.

$month = $form_values['submitted_tree']['your_date_field'][0];

$day = $form_values['submitted_tree']['your_date_field'][1];

$year = $form_values['submitted_tree']['your_date_field'][2];

Elaine Nelson
Oh, I see...you're talking about in just the regular emailing, not theming or additional processing. In that case, it does look like a bug. (Hopefully fixed!)
Elaine Nelson