By RedRat on
First of all, excuse my English.
I'm trying to write a custom module which implements a new CCK field "Date Range". This module has two fields in DB, 'date1' and 'date2', and one textfield widget. Now I'm trying to understand in which hook I have to put code which will split text string from widget to two fields of DB (and vice versa). I have read all documentation for CCK and looked through all the examples in Internet, but can't get it. Mostly all documentation refers CCK 5.x, which has pretty different hooks and operations then 6.x one.
Please, give me a clue!
function date_range_field_settings($op, $field)
...
case 'database columns':
$columns['date1'] = array(
'type' => 'datetime',
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
);
$columns['date2'] = $columns['date1'];
function date_range_widget(&$form, &$form_state, $field, $items, $delta = 0)
...
$element['value'] = array(
'#type' => 'textfield',
Comments
Please, see hook_elements().
Hello!
Good luck!
I apologize for delay in
I apologize for delay in response, but I spent last three days trying to get your code to work. Unfortunately, without any success. I checked my code a few dozens times, but can't get, why 'process' function doesn't executed at all?
This is a code from my module:
No matter what I do, I see only messages from date_range_elements() and date_range_widget() functions, but not from date_range_process() or date_range_element_validate() ones. :-(((
I have done a "clean" install of Drupal 6.22 on empty DB to be sure that there is no any "glitches", but result is the same: my module doesn't call #process function at all, and I think my head is about to burst. Someone, tell me, what I doing wrong?!
Can someone give me a clue,
Can someone give me a clue, what is wrong with code of my module?
So, nobody can help me? :-((
So, nobody can help me? :-((