You are here

function quicklink_update_8502 in Quicklink 8

Same name and namespace in other branches
  1. 2.0.x quicklink.install \quicklink_update_8502()

Set default setting for existing sites.

File

./quicklink.install, line 44
Install hooks for the Quicklink module.

Code

function quicklink_update_8502() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('quicklink.settings');
  $no_load_content_types = $config
    ->get('no_load_content_types');

  // Only re-save the config if there is no pre-existing value.
  if (!isset($no_load_content_types)) {
    $config
      ->set('no_load_content_types', [])
      ->save();
  }
}