1 system.install system_update_1043()

Remove old Date configuration files.

Related topics

File

core/modules/system/system.install, line 2803
Install, update and uninstall functions for the system module.

Code

function system_update_1043() {
  config('date_api.settings')->delete();
  config('date.settings')->delete();

  $config = config('date_views.settings');
  if ($config->isNew()) {
    $config->set('date_views_month_format_with_year', update_variable_get('date_views_month_format_with_year', 'F Y'));
    $config->set('date_views_month_format_without_year', update_variable_get('date_views_month_format_without_year', 'F'));
    $config->set('date_views_day_format_with_year', update_variable_get('date_views_day_format_with_year', 'l, F j, Y'));
    $config->set('date_views_day_format_without_year', update_variable_get('date_views_day_format_without_year', 'l, F j'));
    $config->set('date_views_week_format_with_year', update_variable_get('date_views_week_format_with_year', 'F j, Y'));
    $config->set('date_views_week_format_without_year', update_variable_get('date_views_week_format_without_year', 'F j'));
    $config->save();
  }

  // Remove variables from Drupal 7.
  update_variable_del('date_min_year');
  update_variable_del('date_max_year');
  update_variable_del('date_php_min_year');
  update_variable_del('date_api_use_iso8601');
  update_variable_del('date_db_tz_support');
  update_variable_del('date_api_version');
  update_variable_del('date_popup_timepicker');
  update_variable_del('date_views_month_format_with_year');
  update_variable_del('date_views_month_format_without_year');
  update_variable_del('date_views_day_format_with_year');
  update_variable_del('date_views_day_format_without_year');
  update_variable_del('date_views_week_format_with_year');
  update_variable_del('date_views_week_format_without_year');

  // A default timezone is now always required.
  $default_timezone = config_get('system.date', 'default_timezone');
  if (empty($default_timezone)) {
    $default_timezone = @date_default_timezone_get();
    config_set('system.date', 'default_timezone', $default_timezone);
  }
}