When attempting to export a content type (using content_copy.module) that has a nodereference field that doesn't allow multiple values, I get the following errors:
- NodeReference Field : This post can't be referenced.
- The default value is invalid.
Steps to reproduce:
- Enable the Content, Content Copy, and Node Reference modules.
- Create a new content type, and add a node reference field to it. Do not set the field to allow multiple values.
- Attempt to export the content type.
Result:
The export data for the content type, but none of its fields, is shown. In addition, the error messages described above are displayed.
Investigation:
It appears that when the field settings form is called from drupal_execute and the field is not marked multivalue, the $items[0]['nid'] parameter in nodereference_field('validate', ...) is an array. When the field is marked multivalue, however, or when called from drupal_get_form regardless of the multivalue setting, $items[0]['nid'] is an integer.
Comments
Comment #1
TheMystic commentedI should note that this doesn't occur with the autocomplete widget, only with the select widget.
Comment #2
raspberryman commentedExact same steps to reproduce for me.
Comment #3
scor commentedduplicate of http://drupal.org/node/160660