In file_entity_file_formatter_file_field_view(), you declare a NULL $field variable (line 272 of file_entity.module), and proceed to invoke hook_field_formatter_prepare_view() and hook_field_formatter_view() implementations passing this NULL variable in place of a $field variable containing the field structure.

Passing $field as NULL breaks field formatters like MediaElement which require some information normally contained in the $field variable for proper operation.

Invoking hooks with parameters other than what is specified in the API does not follow best practices, and breaks compatibility.

Comments

dave reid’s picture

Project: D7 Media » File Entity (fieldable files)
Version: 7.x-1.x-dev » 7.x-2.x-dev

Seems to still be active. Transferring to file_entity which will need to be backported to Media 1.x.