You are here

function media_gallery_update_7003 in Media Gallery 7.2

Same name and namespace in other branches
  1. 7 media_gallery.install \media_gallery_update_7003()

Configure gallery nodes to allow video as well as image media.

File

./media_gallery.install, line 1089
Install file for media_gallery. Includes field and instance definitions.

Code

function media_gallery_update_7003() {
  drupal_load('module', 'field');
  $instance = field_info_instance('node', 'media_gallery_media', 'media_gallery');

  // If the instance doesn't exist, we can't update it.
  if ($instance) {
    $instance['widget']['settings']['allowed_types'] = array(
      'image' => 'image',
      'video' => 'video',
    );
    field_update_instance($instance);
  }
}