I'm using the workflow module along with the workflow_fields module to hide CCK fields based on workflow state. Works great except for hiding nodereference fields -- if I set a nodereference field to be hidden and then try to edit/submit the node form I get a "This post can't be referenced" validation error.

I've had this issue before with nodereference fields when trying to hide them manually via hook_form_alter. In this case I have resolved it by changing the check around line 24 in nodereference.module from:
if (!in_array($item['nid'], array_keys($refs)))
to:
if (!in_array($item['nid'], array_keys($refs)) && !in_array($item['nid'][0], array_keys($refs)))

I'd be interested to know if anyone has a better / more permanent solution for this issue.
Brian, Civic Pixel Ltd.

Comments

civicpixel’s picture

correction: around line 124 not 24.

karens’s picture

Status: Active » Closed (won't fix)

Closing old issues. None of us is using the D5 version any more, so hard to provide any support. Sorry.