You are here

function social_event_update_8801 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_8801()
  2. 8.8 modules/social_features/social_event/social_event.install \social_event_update_8801()
  3. 10.0.x modules/social_features/social_event/social_event.install \social_event_update_8801()
  4. 10.1.x modules/social_features/social_event/social_event.install \social_event_update_8801()
  5. 10.2.x modules/social_features/social_event/social_event.install \social_event_update_8801()

Fix empty value in enroll setting.

File

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

Code

function social_event_update_8801() {

  // This does not need to run before 8802 necessarily because the
  // features_removal/ folder has also been updated so a revert works too.
  // This update mostly exists for people who've already updated to 8.0.
  $settings = \Drupal::configFactory()
    ->getEditable('social_event.settings');
  $enroll = $settings
    ->get('enroll');

  // Only change it if no value was set yet.
  if (empty($enroll)) {
    $settings
      ->set('enroll', [])
      ->save();
  }
}