Closed (fixed)
Project:
Date
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2007 at 10:07 UTC
Updated:
7 Mar 2007 at 12:31 UTC
When editing an existing node the from date is set to the to date at my installation (Drupal 5.1).
It seems like the value entry of the params array is never set to the from value in date_widget().
I added only one line to correct this (line 539):
else {
$params['label'] = t('From:');
$params['field_name'] = 'value';
$form[$field['field_name']][$delta] = date_text_input($params);
$params['label'] = t('To:');
$params['field_name'] = 'value2';
$params['required'] = $field['todate'] == 'required' && ($field['value'] || $field['required']) ? TRUE : FALSE;
if (!$params['required'] && empty($delta['value2'])) $params['blank_default'] = 1;
$params['value'] = $items[$delta]['value2']; // <- this on is new
$form[$field['field_name']][$delta] += date_text_input($params);
$form[$field['field_name']][$delta]['value2']['#weight'] += .1;
$form[$field['field_name']][$delta]['#empty'] = empty($items[$delta]['value']) && empty($items[$delta]['value2']) ? TRUE : FALSE;
}
Comments
Comment #1
mphilipp commentedI am sorry, this is the wrong module, moved to date.module.
Comment #2
mphilipp commentedAdditional info: datestamp field; jscalendar; site, Europe/Berlin; multiple not used, only from date required
Comment #3
karens commentedThat correction was made on Feb 8 and several other changes have been made since then, so you are not using the latest development snapshot. If you get current you should have no problems.
Comment #4
mphilipp commentedI didn't use HEAD but I'm pretty sure I used the latest 5.x-1.x-dev package. Never mind.
Comment #5
(not verified) commented