You are here

function social_event_managers_update_8004 in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install \social_event_managers_update_8004()
  2. 10.0.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install \social_event_managers_update_8004()
  3. 10.1.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install \social_event_managers_update_8004()
  4. 10.2.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install \social_event_managers_update_8004()

Add new field for rendered profile entity so we can sort it.

Load in a config file from an specific update hook that will never change. Update helper did not update all fields correctly.

File

modules/social_features/social_event/modules/social_event_managers/social_event_managers.install, line 76
Install, update and uninstall functions for the social_event_managers module.

Code

function social_event_managers_update_8004() {
  $config_file = drupal_get_path('module', 'social_event_managers') . '/config/update/social_event_managers_update_8004.yml';
  if (is_file($config_file)) {
    $settings = Yaml::parse(file_get_contents($config_file));
    if (is_array($settings)) {
      $config = \Drupal::configFactory()
        ->getEditable('views.view.event_manage_enrollments');
      $config
        ->setData($settings)
        ->save(TRUE);
    }
  }
}