You are here

function loqate_update_8005 in Loqate 2.x

Updated config to capture the field mapping enabled boolean.

File

./loqate.install, line 79
Contains loqate.install.

Code

function loqate_update_8005() {

  // Register enabled as TRUE for pre-existing config values.
  $pca_address_config = \Drupal::configFactory()
    ->getEditable('loqate.settings');
  $pca_fields = $pca_address_config
    ->get('pca_fields');
  foreach ($pca_fields as $i => $pca_field) {
    $pca_fields[$i]['enabled'] = TRUE;
  }

  // Set new value in config.
  $pca_address_config
    ->set('pca_fields', $pca_fields)
    ->save();
}