You are here

function webform_update_8158 in Webform 6.x

Same name and namespace in other branches
  1. 8.5 includes/webform.install.update.inc \webform_update_8158()

Issue #3023863: Typo in State/Province codes options.

File

includes/webform.install.update.inc, line 3001
Archived Webform update hooks.

Code

function webform_update_8158() {

  /** @var \Drupal\webform\WebformOptionsInterface $webform_options */
  $webform_options = WebformOptions::load('state_province_codes');
  if (!$webform_options) {
    return;
  }
  $options = $webform_options
    ->getOptions();
  if (isset($options['AE']) && $options['AE'] === 'Armed Forces (Canada, Europe, Africa, or Middle East') {
    $options['AE'] = 'Armed Forces (Canada, Europe, Africa, or Middle East)';
    $webform_options
      ->setOptions($options)
      ->save();
  }
}