Skip to content
Snippets Groups Projects

Fix issue with the hook_update #8003 when zone id is already stored as an array.

1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
+ 3
1
@@ -78,7 +78,9 @@ function cloudflare_update_8003(&$sandbox) {
// Convert existing zone id value from type string to array.
$config = \Drupal::service('config.factory')->getEditable('cloudflare.settings');
$zone_id = $config->get('zone_id');
$config->set('zone_id', $zone_id ? [$zone_id] : [])->save();
if (!is_array($zone_id)) {
$config->set('zone_id', $zone_id ? [$zone_id] : [])->save();
}
}
/**
Loading