oembedfield.install in oEmbed 7
File
modules/oembedfield/oembedfield.install
View source
<?php
function oembedfield_update_dependencies() {
$dependencies['oembedcore'][7004] = array(
'oembedfield' => 7000,
);
return $dependencies;
}
function oembedfield_update_7000() {
foreach (field_info_fields() as $field_name => $info) {
if ($info['type'] == 'link_field') {
foreach ($info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle_name) {
$instance = field_read_instance($entity_type, $field_name, $bundle_name);
foreach ($instance['display'] as &$display) {
if ($display['module'] == 'oembedfield') {
$changed = TRUE;
$display['module'] = 'oembedcore';
}
}
if ($changed) {
field_update_instance($instance);
}
$changed = FALSE;
}
}
}
}
}