You are here

function acquia_lift_update_8400 in Acquia Lift Connector 8.4

Remove deprecated configuration and update content replacement mode.

File

./acquia_lift.install, line 34

Code

function acquia_lift_update_8400() {
  $config = Drupal::configFactory()
    ->getEditable('acquia_lift.settings');

  // Remove stored values of authentication url and content origin.
  $config
    ->clear('credential.oauth_url');
  $config
    ->clear('credential.content_origin');

  // Save trusted mode for sites having the deprecated untrusted mode set.
  if ($config
    ->get('advanced.content_replacement_mode') == 'untrusted') {
    $config
      ->set('advanced.content_replacement_mode', 'trusted');
  }
  $config
    ->save();
}