I upgraded to latest dev version (02-Aug-2011) and I get the following error messages:

Fatal error: Call to a member function render() on a non-object in ....\sites\all\modules\references\views\references_plugin_style.inc on line 32

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

Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1418 of ...\modules\taxonomy\taxonomy.module).

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7383 of ...\includes\common.inc).

I'm not sure if they are all caused by this module.

Files: 
CommentFileSizeAuthor
#12 1249268_node_reference_wsod-12.patch693 bytesAron Novak
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]
#9 node_reference_php_warnings.patch655 bytesmh86
PASSED: [[SimpleTest]]: [MySQL] 14 pass(es).
[ View ]

Comments

I have investigated the errors and managed to make them go away.
a) The first and last 2 errors went away when i removed the nodes which had taxonomy terms whose parent vocabulary I had deleted.
b) I noticed the 2nd error is actually a bug in node_reference.module. The issues are in function node_reference_field_formatter_view().

/**
* Implements hook_field_formatter_view().
*/
function node_reference_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $result = array();
  switch ($display['type']) {
    case 'node_reference_default':
    case 'node_reference_plain':
      foreach ($items as $delta => $item) {
        if ($item['access']) {
          $node = $item['node'];
          if ($display['type'] == 'node_reference_default') {
            $uri = entity_uri('node', $node);
            $result[$delta] = array(
              '#type' => 'link',
              '#title' => $node->title,
              '#href' => $uri['path'],
              '#options' => $uri['options'],
            );
          }
          else {
            $result[$delta] = array(
              '#markup' => check_plain($node->title),
            );
          }
          if (!$node->status) {
            $result[$delta]['#prefix'] = '<span class="node-unpublished">';
            $result[$delta]['#suffix'] = '</span>';
          }
        }
      }
      break;

Problem 1: There is no implementation for display type 'node_reference_default' yet the function is in some instances being called with this display type
Temporary Fix: Combine first two cases
switch ($display['type']) {
   // case 'node_reference_default':
    case 'node_reference_plain' || 'node_reference_default':
      foreach ($items as $delta => $item) {

Problem 2: The statement $node = $item['node'] does not work for node reference field in a field_collection_item.
solution: load the node if entity_type is field_collection_item

if ($entity_type == 'field_collection_item'){
    $node = node_load($item['nid']);
  } else{
  $node = $item['node'];
  }

Problem 3: The expression $item['access'] is also not available for node reference field in a field_collection_item.
Temporary Fix: disable/comment out checking for 'access'

Coming from #1250012: Notice: Undefined index: access in node_reference_field_formatter_view() .

The fix for problem 1 is redundant, that's how switch/case statements work, listing them back to back is a fall-through and is equivalent to what you've typed out.

While I was initially happy to hear it wasn't my bug, I still am not sure of this. References shouldn't care have to worry about field_collection_items, so the solution for problem 2 is likely not the best way. Though I'm not 100% on that.

When it's a field_collection_item, what is in $item['node']? If nothing, then this would be best:

$node = !empty($item['node']) ? $item['node'] : node_load($item['nid']);

@tim.plunkett: Thanks. I agree with all your points. $item['node'] doesn't exist for field_collection_item, therefore your suggested statement is the best to cater for any other module which doesn't set the value. How about if ($item['access']) { , Is it proper to bypass that check here when $item['access'] is not set or some other module has to set it. Which module would that be? Perhaps field_collection which creates the field instance in the first place or entity that loads the entity?

I'm noticing that this issue has far reaching effects. Apart from node reference it also affects field formatters for taxonomy and media modules i.e functions taxonomy_field_formatter_view() and media_field_formatter_view() respectively.

Same problem here with node references and $item['access']. My node reference field is attached to a message entity (message.module) and I'm getting the Notice: Undefined index: access in node_reference_field_formatter_view() error

Same issue here with References + Field Collection + Field Collection Table... subscribing.

subscribing, having the same problem

I'm having a view with messages which have a node reference field attached. I use this field for filtering the messages via a contextual argument - so no content of the node reference is actually shown.
Nevertheless, I receive lots of "Undefined index: access ..." warnings. As I can see from the code node_reference_field_formatter_view() needs node_reference_field_formatter_prepare_view() first, which isn't invoked in my case. But why is a formatter function ever invoked when I'm not showing the field?

Status:Active» Needs review
StatusFileSize
new655 bytes
PASSED: [[SimpleTest]]: [MySQL] 14 pass(es).
[ View ]

here a quick fix that prevents the warnings, but I'm not sure if it solves the original problem.

I applied the patch on comment #9, but the error still appears on the status report page:

Notice: Undefined index: node in node_reference_field_formatter_view() (line 441 of /home/administrator/metalface/sites/all/modules/references/node_reference/node_reference.module).

This alert appears when I run cron. I believe that, this also affects search indexing. I re-indexed my site. There are 7000 nodes. Each time I run cron, 500 items are indexed. It went well for first 5000 items. There was no error. Then for the last 2000 nodes, this error appeared on the "status report" page after I run cron. Remaining 2000 nodes arent indexed.

When I look at the logs, I also see this error when I run cron:

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7539 of /home/administrator/metalface/includes/common.inc).

StatusFileSize
new693 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Try this.

This patch worked for me

Status:Needs review» Reviewed & tested by the community

I manually applied this patch to the 7.x-2.1 branch and it has appeared to fix the issue. It would be nice to get this into the next release.

Also solid and working for me.

Assigned:Unassigned» Alex Andrascu
Issue summary:View changes

Ok let's get it in then