function openlayers_update_6201 in Openlayers 6.2
Implementation of hook_update_N().
File
- ./
openlayers.install, line 203 - This file holds the functions for the installing and enabling of the openlayers module.
Code
function openlayers_update_6201(&$sandbox) {
$message = 'Did not alter OpenLayers source.';
// Due to some changes in the OpenLayers JS in
// version 2.10, errors crop up, so we will
// manually set to 2.9. Assume change if
// not set or set to http://openlayers.org/api/OpenLayers.js
$current = variable_get('openlayers_source', FALSE);
if (!$current || $current == 'http://openlayers.org/api/OpenLayers.js') {
variable_set('openlayers_source', 'http://openlayers.org/api/2.9/OpenLayers.js');
$message = 'Set OpenLayers source to hosted 2.9 version.';
}
// Add simple note
$ret[] = array(
'success' => TRUE,
'query' => $message,
);
return $ret;
}