When "Use fallback behavior when editing content" is turned on the new node form at node/add/TYPE/NID does not have my node reference field displayed.
I believe this is because of a if on line 396
<?php
if (isset($referenced_nid) && (empty($field['widget']['edit_fallback']))) {
$element[0]['nid'] = array(
'#title' => $field['widget']['label'],
'#type' => 'nodereference_url',
'#field_name' => $field_name,
'#default_value' => $referenced_nid,
);
}
?>
I think this is a mistake but I do not know what one is trying to catch here
Comments
Comment #1
batbug2 commentedYep, same problem here.
Solved by changing that line #396 to
Comment #2
hefox commentedI believe it's trying to catch the case that the field has not already been set to something (ie a select or autocomplete).
Comment #3
quicksketchThanks hefox for the patch! I hadn't thought about using the $element['#type'] as the check, but it seems like it works really well. The only problem I found was that it did not work well when editing a node that was using the "leave blank" mode (it would delete any existing value). To fix this, I made the "leave blank" option fallback to autocomplete during edits if using the fallback behavior during edit (we're already doing this for the "page not found" mode).
Comment #4
quicksketchComment #6
perforator commentedWhy didn't the patch make it into 1.6?
Comment #7
perforator commentedReopening since the patch is still not included. It works for me but some maintainers should take a look at it.
Comment #8
quicksketchIt is in 1.6: http://drupalcode.org/viewvc/drupal/contributions/modules/nodereference_...