Hello,

using latest version of drupal on Fedora Core 4. I get this in my httpd's error log:

PHP Fatal error: Cannot use object of type stdClass as array in /var/www/html/drupal-4.6.3/modules/subscription/subscription.module on line 225, referer: http://lab-nucular/drupal/?q=comment/reply/175

This happens when I reply to a post and hit "Post comment". I also only get a blank page. Hitting reload would post the reply twice.

Comments

rav-1’s picture

Version: 4.6.x-1.x-dev » master

Get a similar error, however using gentoo. When i attempt to add a comment to a blog where someone else has subscribed to it I get the following error

Fatal error: Cannot use object of type stdClass as array in /var/www/localhost/htdocs/drupal/modules/subscription.module on line 225

using php 5.0.4

Any help/ideas in this matter would be fantastic
Thanks in advance
Ravi

labmeister’s picture

I think this has something to do with PHP 5. For now the subscriptioin module is deactivated, but I hope this workaround is temporary.
Solutions, suggestions, anyone?

greggles’s picture

line 255:
$new_object = (array_merge($comment, array('parent_uid' => $parent_node['uid'])));

I do remember reading something about PHP4 being tolerant of the use of object's as arrays while php5 is not so

PHP5 needs to do $parent_node->uid instead of $parent_node['uid']

$parent_node is the returned node object of a call to $node_load, so this should be fixed by using $parent_node->uid notation.

I don't have this problem, can someone who does try out my solution to see if it works?

oliveaddict’s picture

Yep, that fixed it. Thanks!

On Drupal 4.6.3, PHP 5.0.5, Subscription 'cvs-211005'

I changed line 225

From:
$new_object = (array_merge($comment, array('parent_uid' => $parent_node['uid'])));

To:
$new_object = (array_merge($comment, array('parent_uid' => $parent_node->uid)));

vkareh’s picture

Status: Active » Closed (fixed)