There seems to be a problem displaying data in node and term reference fields provided by the References module

I get the following error message if I have a node reference field in the field collection.

Notice: Undefined index: access in node_reference_field_formatter_view() (line 394 of ...\sites\all\modules\references\node_reference\node_reference.module).

Comments

tim.plunkett’s picture

Status: Active » Postponed (maintainer needs more info)

Have you tried it with the other formatters, View and List?
Just trying to make sure its not a bug of Field Collection itself.

chalee’s picture

I have tried with other formatters and its working fine. I have been investigating the problem and I think I have pinpointed the source.

In function field_collection_table_field_formatter_view() in the field_collection_table.module file, there is the following statement at line number 75, thereabouts.

 $content = $field_collection->buildContent();

The function buildContent() is NOT returning all reference fields' data. I tried to find this function in field_collection_table and field_collection modules files and on api.drupal.org but could not find it. Where is it defined?

tim.plunkett’s picture

It's part of the entity module, see here. I appreciate your attempts to debug, if you can provide any more info, that'd be great.

chalee’s picture

After a very long debugging effort through numerous linked functions in entity API module, core field module and then out of core into reference module, I finally managed to get to the root of the problem which is in reference module. I updated my findings and temporary fixes in this issue #1249268: Undefined index: access in node_reference_field_formatter_view() I posted in References module

tim.plunkett’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

I'm going to mark this as a duplicate for now, if it turns out there is something that can be done outside of references to fix this, we can re-open it.