On date_elements.incif you create a date field follwig the required structure in services, on line 440 receive the nxt error:

Invalid argument supplied for foreach() ..

This is due to in a programmatically creation of a node you can send an to_data that is not an array.

To solve this:

if ($field['todate']) {
$merged_date = array();
$to_date_empty = TRUE;
//Code addded
if(is_array($posted[$to_field]))
//End code added
foreach ($posted[$to_field] as $part => $value) {
$to_date_empty = $to_date_empty && empty($value);
$merged_date[$part] = empty($value) ? $posted[$from_field][$part] : $value;
if ($part == 'ampm' && $merged_date['ampm'] == 'pm' && $merged_date['hour'] < 12) {
$merged_date['hour'] += 12;
}
elseif ($part == 'ampm' && $merged_date['ampm'] == 'am' && $merged_date['hour'] == 12) {
$merged_date['hour'] -= 12;
}
}

Comments

DamienMcKenna’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Unfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.