It took me some time to figure out where a number is added to the fieldset title of a from/to date widget. But I still don't know why this is done. I'm sure there is a very good reason for this, but I don't get it.

This is the code I am referring to (date.module, line 884):

/**
 *  Theme from/to date combination on form.
 */
function theme_date_form_combination($form) {
  $fieldset = array(
    '#title' => $form['#title'] . ' '. intval($form['#delta'] + 1),
    '#value' => drupal_render($form),
  );
  $output = theme('fieldset', $fieldset);
  return $output;
}

Comments

karens’s picture

Status: Active » Fixed

It's mostly to provide a distinction between multiple date fields with the same label. I just realized the first one doesn't need a number appended, which will keep it from happening on a non-multiple field, so I just committed a fix for that. You can also override this behavior in your theme (theme_date_form_combination($form)).

mphilipp’s picture

Thank you!

Anonymous’s picture

Status: Fixed » Closed (fixed)