You are here

function media_gallery_update_7008 in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 media_gallery.install \media_gallery_update_7008()

Ensure that the description fields for galleries and media allow filtered text.

File

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

Code

function media_gallery_update_7008() {

  // Ensure that the media_description field is filtered text.
  foreach (array(
    'video',
    'image',
  ) as $bundle) {
    $instance = field_info_instance('media', 'media_description', $bundle);
    if ($instance) {
      $instance['settings']['text_processing'] = 1;
      field_update_instance($instance);
    }
  }

  // Ensure that the media_gallery_description field is filtered text.
  $instance = field_info_instance('node', 'media_gallery_description', 'media_gallery');
  if ($instance) {
    $instance['settings']['text_processing'] = 1;
    field_update_instance($instance);
  }
}