You are here

function opigno_module_update_8012 in Opigno module 8

Update configuration for Slide activity type.

File

./opigno_module.install, line 902
Opigno module app install/update functionality.

Code

function opigno_module_update_8012() {

  // Install module.
  \Drupal::service('module_installer')
    ->install([
    'pdf',
  ]);

  // Update configs for Slide activity type.
  $config_path = drupal_get_path('module', 'opigno_module') . '/config/optional';

  /* @var Drupal\Core\Config\CachedStorage $config_storage */
  $storage = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');
  $data = $storage
    ->read('core.entity_view_display.media.pdf_file.embedded_display');
  $config_storage
    ->write('core.entity_view_display.media.pdf_file.embedded_display', $data);
  $data = $storage
    ->read('core.entity_view_display.opigno_activity.opigno_slide.activity');
  $config_storage
    ->write('core.entity_view_display.opigno_activity.opigno_slide.activity', $data);
}