You are here

function fb_instant_articles_update_8201 in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 fb_instant_articles.install \fb_instant_articles_update_8201()

Change the enable_logging setting to transformer_logging_level.

File

./fb_instant_articles.install, line 13
Install and update hooks.

Code

function fb_instant_articles_update_8201() {

  // Enable serialization module on update (is a dependency now).
  \Drupal::service('module_installer')
    ->install([
    'serialization',
  ]);
  $config = \Drupal::configFactory()
    ->getEditable('fb_instant_articles.settings');
  $enable_logging = $config
    ->get('enable_logging');
  if ($enable_logging) {
    $config
      ->set('transformer_logging_level', TransformerLog::ERROR);
  }
  else {
    $config
      ->set('transformer_logging_level', TransformerLog::OFF);
  }
  $config
    ->clear('enable_logging');
  $config
    ->save();
}