[Drupal] Editing How to modify the CCK date field, set its to-date to null

Modify the file, sites/all/modules/date/date_elements.inc

 

function date_combo_validate(), maybe line 521,
after the code

if (empty($errors)) {

 

add these:

if ($to_date_empty) {
$item[$to_field] = null;
}

 

sites/all/modules/date/date.theme

function theme_date_display_combination(), maybe line 126
before the code:

if (empty($date1) && empty($date2))

 

add these :

if (empty($element['#node']->node_data_field_date_1_field_date_1_value2)) {
$date2 = null;
}

 

posted @ 2010-09-07 20:52  DavidHHuan  阅读(271)  评论(0编辑  收藏  举报