Closed (fixed)
Project:
Popups: Add and Reference
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2008 at 12:14 UTC
Updated:
7 Nov 2008 at 16:41 UTC
'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
Comment #1
kenorb commentedOther issue, node_reference hasn't dependency to content module as it used content_fields().
Comment #2
starbow commentedThis didn't make it into beta1, but it is fixed in head.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.