1 system.install system_update_1093()

Set defaults for date_views if not already set.

Related topics

File

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

Code

function system_update_1093() {
  // Previously date_views settings were being removed before they could be
  // migrated. If that's the case set some defaults here.
  // @see https://github.com/backdrop/backdrop-issues/issues/6204
  $config = config('date_views.settings');
  if (!$config->isNew()) {
    return;
  }
  $config->set('date_views_month_format_with_year', 'F Y');
  $config->set('date_views_month_format_without_year', 'F');
  $config->set('date_views_day_format_with_year', 'l, F j, Y');
  $config->set('date_views_day_format_without_year', 'l, F j');
  $config->set('date_views_week_format_with_year', 'F j, Y');
  $config->set('date_views_week_format_without_year', 'F j');
  $config->save();
}