Selecting table format causes "Fatal error: Call to undefined function field_collection_field_get_entity() in sites/all/modules/field_collection_table/field_collection_table.module on line 51" when i access the front end content type's page. If i select list or view format, everything works OK.

Comments

calculus’s picture

Actually, modifying line 51

from:
if ($field_collection = field_collection_field_get_entity($item)) {

to:
if ($field_collection = isset($item['entity']) ? $item['entity'] : field_collection_item_load($item['value'])) {

as original patch(#1096320: Adding Table Formatter comment 1), fixes the problem.

tim.plunkett’s picture

Status: Active » Postponed (maintainer needs more info)

Please ensure that you are running the latest version of field_collection. The change you specify is basically rewriting the function, which should be available as of June 7th.

calculus’s picture

I'm running Field collection 7.x-1.0-beta1 not the dev one. Is dev package necessary?

tim.plunkett’s picture

Title: Fatal error after selecting Table Format » Fatal error after selecting Table Format using field_collection-7.x-1.0-beta1
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Yes, the beta is 5 months old, and doesn't have the function that this module is using.

calculus’s picture

Priority: Normal » Critical
Status: Closed (works as designed) » Postponed (maintainer needs more info)

You said that the change above is rewriting the function which will be available soon. Does that mean that the module will run with the beta1 field collection?

tim.plunkett’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (works as designed)

I wrote this module yesterday. I used the latest version of field_collection available. I am not writing a workaround for a bug that was fixed a month ago.

Hopefully there will be another beta version of field_collection soon, but until it's stable, you might be better off with the dev version.