<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body style="direction: ltr;" bgcolor="#ffffff" text="#000000">
<p style="margin-bottom: 0cm; margin-top: 0pt;">Hi. I am hooking a node
form. The content type has a cck node reference field, and the form
has a text field to select the node. In some cases, the user should not
be allowed to select...the value should be forced. So I decide which
field name to use based on the content type, and then change the text
field to a hidden field like this:<br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"> $form[$var] =
array(</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"> '#type' =>
'hidden',<br>
'#value' => $nid,<br>
);</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;">The form comes up just
fine. The problem is, when it is submitted, I receive:</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
<b>Fatal error</b>: Cannot unset string offsets in <b>sites\all\modules\cck\content.module</b>
on line <b>1248</b></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;">Thanks,</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;">Jeff<br>
</p>
</body>
</html>