In latest -dev of Media and File Entity, visiting the admin/content/file/thumbnails page yields up 2 PHP notices for every document file type in the list (which use the large_icon formatter, by default):

Notice: Undefined offset: 0 in media_field_formatter_view()

This is being generated by lines 70 and 71 in includes/ - which itself is (according to the comments) a legacy support hack for the large file icon formatter. The whole snippet is:

$element[$delta] = array(
  '#theme' => 'media_formatter_large_icon',
  '#file' => (object) $item,
  '#attributes' => array(
    'width' => $style['effects'][0]['data']['width'],
    'height' => $style['effects'][0]['data']['height'],

In my case, though (at least), the relevant effects delta for the media_thumbnail size is 11, and there's no delta 0.

I can't think how to programmatically find the relevant width and height to make the thumbnails grid consistent, so for now I've just hardcoded in the current media_thumbnail width and height to 100 x 100.

Is there a better way to handle the formatters for these non-image icons?


olak’s picture

Devin Carlson’s picture

Issue summary: View changes
Status: Active » Fixed

I'm not able to duplicate this using the latest Media -dev.

Marking this as fixed since the referenced code no longer exists; the image height and width is now taken from the file icon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.