Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
rav-1 CreditAttribution: rav-1 commentedGet 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
Comment #2
labmeister CreditAttribution: labmeister commentedI 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?
Comment #3
gregglesline 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?
Comment #4
oliveaddict CreditAttribution: oliveaddict commentedYep, 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)));
Comment #5
vkareh CreditAttribution: vkareh commented