function galleria_update_7002 in Galleria 7
Updates renamed field formatter settings.
File
- ./
galleria.install, line 198 - Install, update and uninstall functions for the galleria module.
Code
function galleria_update_7002() {
drupal_load('module', 'field');
foreach (field_info_instances('node') as $node_type => $field_instances) {
foreach ($field_instances as $field_instance) {
$changed = FALSE;
foreach ($field_instance['display'] as &$display) {
if ($display['module'] == 'galleria' && $display['type'] == 'galleria') {
$settings =& $display['settings'];
$settings['optionset'] = $settings['galleria_optionset'];
unset($settings['galleria_optionset']);
unset($settings['galleria_reference_img_src']);
$changed = TRUE;
}
}
if ($changed) {
field_update_instance($field_instance);
}
}
}
}