You are here

function opigno_forum_update_8001 in Opigno forum 8

Implements hook_update_N()

Fix issue with access to the forum node type.

File

./opigno_forum.install, line 84
Install, update and uninstall functions for the Opigno Forum module.

Code

function opigno_forum_update_8001() {

  // Install module.
  \Drupal::service('module_installer')
    ->install([
    'gnode',
  ]);
  $config_path = drupal_get_path('module', 'opigno_forum') . '/config/install';

  /* @var Drupal\Core\Config\CachedStorage $config_storage */
  $storage = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');
  $data = $storage
    ->read('group.content_type.learning_path-group_node-forum');
  $config_storage
    ->write('group.content_type.learning_path-group_node-forum', $data);
}