You are here

function autosave_form_update_8001 in Autosave Form 8

Add the settings for the notification to the settings config.

File

./autosave_form.install, line 90
Install, update and uninstall functions for the autosave_form module.

Code

function autosave_form_update_8001() {
  $config = \Drupal::configFactory()
    ->getEditable('autosave_form.settings');
  if ($config
    ->get('notification') === NULL) {
    $config
      ->set('notification', [
      'active' => TRUE,
      'message' => 'Saving draft...',
      'delay' => 1000,
    ]);
    $config
      ->save(TRUE);
  }
}