You are here

function openlayers_update_7206 in Openlayers 7.2

Rename the 'base_url' in 'url' in layer type TMS.

File

./openlayers.install, line 403
This file holds the functions for the installing and enabling of the openlayers module.

Code

function openlayers_update_7206() {
  openlayers_update_create_projection_table();
  foreach (openlayers_layers_load() as $key => $layer) {
    if ($layer->export_type != 1) {
      continue;
    }
    if ($layer->data['layer_type'] != 'openlayers_layer_type_tms') {
      continue;
    }
    if (isset($layer->data['base_url'])) {
      $layer->data['url'] = $layer->data['base_url'];
      unset($layer->data['base_url']);
      ctools_export_crud_save('openlayers_layers', $layer);
    }
  }
}