[development] Problem with hook_form_alter: Cannot unset string offsets
Jeff Greenberg
jeff at ayendesigns.com
Mon Jun 28 15:19:19 UTC 2010
Well, that's an interesting point, and negates my previous comment.
Since I'm starting with $form[$var] = array( I won't have any
artifacts from the original field, will I? So wouldn't the field then be
composed of only those two parameters, #type and #value? That should be
all it needs. Changed it to 'value' from 'hidden', unfortunately there
was no side benefit of correcting it.
When I change it from $form[$var] = array( to $form[$var]['#type'] =
etc. I no longer get the from, but get the error Only variables can be
passed by reference
Jeff
On 6/28/2010 10:57 AM, Steve Ringwood wrote:
> Whats the value of $var?
>
> Because it's a CCK field you may need to use
> $form[$var]['#type'] = 'hidden';
> $form[$var]['#value'] = $nid;
> to avoid clearing elements CCK expects to find.
>
> (Side note: I would use 'value' instead of 'hidden')
>
> Nevets
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100628/9b7e36a5/attachment-0001.html
More information about the development
mailing list