You are here

function bynder_update_8400 in Bynder 4.0.x

Remove old configuration, manual reconfiguration is necessary.

File

./bynder.install, line 195
Install, uninstall and update hooks for Bynder module.

Code

function bynder_update_8400() {
  $config = \Drupal::configFactory()
    ->getEditable('bynder.settings');
  $config
    ->set('account_domain', str_replace('https://', '', $config
    ->get('account_domain')));
  $config
    ->clear('consumer_key');
  $config
    ->clear('consumer_secret');
  $config
    ->clear('token');
  $config
    ->clear('token_secret');
  $config
    ->save();
  return t('Bynder configuration has changed, a permanent token and optionally client id/secret is now required instead of the previous API keys. Reconfigure it on the configuration page.');
}