Index: date_api.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/Attic/date_api.admin.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 date_api.admin.inc --- date_api.admin.inc 25 Jan 2009 13:03:13 -0000 1.1.2.1 +++ date_api.admin.inc 20 Feb 2009 00:37:18 -0000 @@ -131,6 +131,15 @@ function date_api_date_format_form_eleme } } +function date_api_date_time_settings_validate($form, &$form_state) { + $all_formats = date_get_formats(); + foreach ($all_formats as $type => $formats) { + if (in_array($form_state['values']['add_date_format'], array_keys($formats))) { + form_set_error('add_date_format', t('This format already exists. Please enter a unique format string.')); + } + } +} + function date_api_date_time_settings_submit($form, &$form_state) { if (!empty($form_state['values']['add_date_format'])) { $format = array(); Index: date/date.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/date/date.module,v retrieving revision 1.61.2.4.2.47 diff -u -p -r1.61.2.4.2.47 date.module --- date/date.module 13 Feb 2009 23:07:50 -0000 1.61.2.4.2.47 +++ date/date.module 20 Feb 2009 00:37:20 -0000 @@ -279,13 +279,16 @@ function date_theme() { ), ); - $format_types = date_get_format_types('', TRUE); - if (!empty($format_types)) { - foreach ($format_types as $type => $type_info) { - $themes['date_formatter_' . $type] = $base + array( - 'arguments' => array('element' => NULL), - 'function' => 'theme_date_display_combination', - ); + // Table isn't available first time date_theme() is called in update.php. + if (db_table_exists('date_format_types')) { + $format_types = date_get_format_types('', TRUE); + if (!empty($format_types)) { + foreach ($format_types as $type => $type_info) { + $themes['date_formatter_' . $type] = $base + array( + 'arguments' => array('element' => NULL), + 'function' => 'theme_date_display_combination', + ); + } } }