I use Exif module (not actively maintained). And I get the following error opening the EXif admin page:
Fatal error: Call to undefined function media_type_get_types() in /home/vhosts/bioscene/dev1/sites/all/modules/exif/exif.admin.inc on line 127
Since I was unable to find media.types.inc (that should include media_type_get_types) I guess this is a version issue. Can anyone tell how should I modify Exif module code to make it work:

  if (module_exists("media")) {
    $all_mt = array();
    // Setup media types
    $types = media_type_get_types();
    foreach ($types as $key) {
      $all_mt[$key->name] = $key->name;
    }
    $forms['exif_mediatypes'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Mediatypes'),
      '#options' => $all_mt,
      '#default_value' => variable_get('exif_mediatypes', array()),
      '#description' => t('Select mediatypes which should be checked for itpc & exif data.'),
    );
  }

Comments

devin carlson’s picture

Title: Undefined media_type_get_types » media_type_get_types() is no longer part of media 2.x
Project: D7 Media » Exif
Version: 7.x-2.x-dev » 7.x-1.x-dev
Category: support » task

All file types functionality is now part of the File Entity module.

You'll most likely want to use file_type_get_enabled_types() in place of media_type_get_types().

markisatacomputer’s picture

StatusFileSize
new878 bytes

Here's a patch do just that. I'm using exif 7.x-1.2

Thithi32’s picture

Status: Active » Closed (fixed)

Thank you both very much. markisatacomputer patch works perfectly.