You are here

function social_event_update_8809 in Open Social 10.3.x

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

Update the enrollment method text of an event on event add form.

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/social_event.install, line 1539
Install, update and uninstall functions for the social_event module.

Code

function social_event_update_8809() {
  $config_file = drupal_get_path('module', 'social_event') . '/config/update/social_event_update_8809.yml';
  if (is_file($config_file)) {
    $settings = Yaml::parse(file_get_contents($config_file));
    if (is_array($settings)) {
      $config = \Drupal::configFactory()
        ->getEditable('field.storage.node.field_enroll_method');
      $config
        ->setData($settings)
        ->save(TRUE);
    }
  }
}