You are here

function media_acquiadam_update_8106 in Media: Acquia DAM 8

Update Acquia Dam settings to fix a schema issue with sync_interval.

File

./media_acquiadam.install, line 213
Installation related hooks and functions.

Code

function media_acquiadam_update_8106(&$sandbox) {
  $config = \Drupal::configFactory()
    ->getEditable('media_acquiadam.settings');
  $sync_interval = $config
    ->get('sync_interval');

  // If the interval is set to 0,
  if ($sync_interval === '0') {
    $int_val = 0;
  }
  else {
    $int_val = intval($sync_interval);
  }
  $config
    ->set('sync_interval', $int_val);
  $config
    ->save();
}