You are here

function diff_update_8004 in Diff 8

Enable all layout plugins to be used.

File

./diff.install, line 93
Installation hooks for diff module.

Code

function diff_update_8004() {
  $config = \Drupal::configFactory()
    ->getEditable('diff.settings');
  $plugins = \Drupal::service('plugin.manager.diff.layout')
    ->getDefinitions();
  foreach ($plugins as $key => $value) {
    $plugin_options[$key] = $value['label'];
    $config
      ->set('general_settings.layout_plugins.' . $key . '.enabled', TRUE);
  }
  $config
    ->save();
}