You are here

function acquia_contenthub_update_8203 in Acquia Content Hub 8

Set default values for empty keys in acquia_contenthub.entity_config.

File

./acquia_contenthub.install, line 188
Install, update and uninstall functions for the acquia_contenthub module.

Code

function acquia_contenthub_update_8203() {
  $config = \Drupal::configFactory()
    ->getEditable('acquia_contenthub.entity_config');
  if (!$config
    ->get('use_block_content_view_builder')) {
    $config
      ->set('use_block_content_view_builder', FALSE);
  }
  if (!$config
    ->get('user_role')) {
    $config
      ->set('user_role', 'anonymous');
  }
  $config
    ->save();
}