I am coding a hook_comment, which normally specifies "&$a1" in the parameters. It would be helpful to just add some additional stuff to that array before calling drupal_write_record. I have no idea whether the additional data would "upset" the comment module and I don't really need to modify the form data anyway. Would it be reasonable to just drop the ampersand from the parameters? I would definitely add a comment that I'm doing that. Nancy
Safest bet would be just to clone the object with drupal_clone (or just clone() if this will be a PHP 5+ module). Jamie Holly http://www.intoxination.net http://www.hollyit.net On 9/15/2010 12:18 PM, nan wich wrote:
I am coding a hook_comment, which normally specifies "&$a1" in the parameters. It would be helpful to just add some additional stuff to that array before calling drupal_write_record. I have no idea whether the additional data would "upset" the comment module and I don't really need to modify the form data anyway. Would it be reasonable to just drop the ampersand from the parameters? I would definitely add a comment that I'm doing that.
/*Nancy*/
It's a form values array, not an object. And it seems to work without the &. Nancy ________________________________ From: Jamie Holly Safest bet would be just to clone the object with drupal_clone (or just clone() if this will be a PHP 5+ module).
Making a copy of $a1 should be fine. clone() can only receive an object as an argument or it produces a fatal error. On Wed, Sep 15, 2010 at 10:18 AM, nan wich <nan_wich@bellsouth.net> wrote:
I am coding a hook_comment, which normally specifies "&$a1" in the parameters. It would be helpful to just add some additional stuff to that array before calling drupal_write_record. I have no idea whether the additional data would "upset" the comment module and I don't really need to modify the form data anyway. Would it be reasonable to just drop the ampersand from the parameters? I would definitely add a comment that I'm doing that.
*Nancy*
participants (3)
-
Carl Wiedemann -
Jamie Holly -
nan wich