If you create a rule that fills in the default value for a node_reference type CCK field, it will not work when requesting the form.

This is because the default value for fields of this type aren't stored in $field['#default_value'][0]['value'] but in $field['#default_value'][0]['nid']

The attached patch simply always fills in 'nid' as well as 'value'. I have no idea what the correct way is to determine the name of the value element, but at least the patch works and doesn't appear to break existing other field types.

Comments

Status: Needs review » Needs work

The last submitted patch, rules_forms.rules_.inc-node_reference.patch, failed testing.

mitchell’s picture

I think the problem is that the patch isn't from rules' root directory.

mitchell’s picture

Status: Needs work » Needs review
Issue tags: -CCK, -default values, -node_reference

Status: Needs review » Needs work
Issue tags: +CCK, +default values, +node_reference

The last submitted patch, rules_forms.rules_.inc-node_reference.patch, failed testing.

mitchell’s picture

Status: Needs work » Closed (won't fix)
Peter Bex’s picture

Wait, why are you closing it as won't fix?