'Add New:' shouldn't appear when user doesn't have permission to create content.
So solution is to replace in popups_reference_alter_item()
from:

      $form[$key]['#prefix'] = '<div id="'. $id .'">';
      $form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>';

to:

      $form[$key]['#prefix'] = !empty($links) ? '<div id="'. $id .'">' : '';
      $form[$key]['#suffix'] = !empty($links) ? '<div>Add New: ' . implode(', ', $links) .'</div></div>' : '';

So if $links are empty, don't show up.

Second issue is that there is no support for nodereference_autocomplete
So replace:

    if ($field['widget']['type'] == 'nodereference_select') {

with:

    if ($field['widget']['type'] == 'nodereference_select' || $field['widget']['type'] == 'nodereference_autocomplete') {

Comments

kenorb’s picture

Other issue, node_reference hasn't dependency to content module as it used content_fields().

starbow’s picture

Status: Needs review » Fixed

This didn't make it into beta1, but it is fixed in head.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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