You are here

function exclude_node_title_update_8001 in Exclude Node Title 8

Implements hook_update_N().

File

./exclude_node_title.install, line 37
Install and update hooks for Exclude Node Title.

Code

function exclude_node_title_update_8001() {
  $config = \Drupal::configFactory()
    ->getEditable('exclude_node_title.settings');
  $config
    ->set('nid_list', $config
    ->get('exclude_node_title_nid_list'))
    ->set('translation_sync', $config
    ->get('exclude_node_title_translation_sync'))
    ->set('search', $config
    ->get('exclude_node_title_search'))
    ->set('content_types', $config
    ->get('exclude_node_title_content_type_value'));
  $content_types = $config
    ->get('exclude_node_title_content_type_modes');
  foreach ($content_types as $content_type => $modes) {
    $modes = array_filter(unserialize($modes));
    $config
      ->set('content_type_modes.' . $content_type, array_keys($modes));
  }
  $config
    ->clear('exclude_node_title_nid_list')
    ->clear('exclude_node_title_translation_sync')
    ->clear('exclude_node_title_search')
    ->clear('exclude_node_title_content_type_value')
    ->clear('exclude_node_title_content_type_modes')
    ->save();
}