function video_embed_field_update_7008 in Video Embed Field 7.2
Updates naming of 'node' formatter setting to 'content'.
File
- ./
video_embed_field.install, line 321 - Install, update and uninstall functions for the video_embed_field module.
Code
function video_embed_field_update_7008() {
$instances = field_info_instances();
foreach ($instances as $entity_type) {
foreach ($entity_type as $bundle) {
foreach ($bundle as $instance) {
$field_info = field_info_field($instance['field_name']);
if ($field_info['type'] == 'video_embed_field') {
$update = FALSE;
foreach ($instance['display'] as &$display) {
if ($display['type'] == 'video_embed_field_thumbnail') {
if ($display['settings']['image_link'] == 'node') {
$display['settings']['image_link'] = 'content';
$update = TRUE;
}
if ($display['settings']['image_style'] == 'none') {
$display['settings']['image_style'] = '';
$update = TRUE;
}
}
}
if ($update) {
field_update_instance($instance);
}
}
}
}
}
return t("Updated 'node' setting to 'content'");
}