I have use Colorbox File module, that format file entity via colorbox.
It hooks function hook_file_field_formatter_view().
And this formatter need to know current node nid and field name. But nothing about this are sent to it.

In other modules I see that node sends as $entity variable in hook_file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display), but File Entity module sends current file entity instead of node.

In function file_entity_file_formatter_file_field_view() I have found the string:
$field = $instance = NULL;

Why they are null? How can I get current node and field info and send it to function hook_file_field_formatter_view()?

Comments

jwilson3’s picture

For clarification, this issue was spurred by #1165198: Image field gallery, per page/post/field options.

dave reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Cale Bierman’s picture

Status: Active » Postponed (maintainer needs more info)

I tried replicating this issue using Media Colorbox. I can't see anything breaking when I create a view and use the Colorbox formatter, all the images work and load as they should.

Do you have any steps to help re-create the issue?

devin carlson’s picture

Status: Postponed (maintainer needs more info) » Fixed

With #2061531: Double 'Image' file formatter in the 'Manage file display' tab the Media Colorbox module should not longer be necessary as the regular field formatter provided by the Colorbox module should work just fine.

Status: Fixed » Closed (fixed)

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