I've noticed the following notice showing up in my recent log messages

Notice: Trying to get property of non-object in comment_node_page_additions() (line 741 of /Users/dg6/Sites/drupal/modules/comment/comment.module).

The notice is thrown many times for every page load.

It goes away when the commentsblock module is disabled.

I'm going to try and debug the issue, but I'm rather new to php and drupal.

Any suggestions would be great.

CommentFileSizeAuthor
#3 2023849.patch817 bytesnancydru

Comments

mienjob’s picture

Hello, I got the same problem here.

mienjob’s picture

Hello, I solved this problem by changing function "comment_block_static_comments" in file "commentsblock.module", as follow.

Before
--------
function comment_block_static_comments
.....
if (!isset($comments[$nid])) {
$comments[$nid]['links'] = '';
$comments[$nid]['comments'] = comment_node_page_additions($node);
}
......

After
------------
function comment_block_static_comments
......
if (!isset($comments[$nid])) {
$comments[$nid]['links'] = '';
if($node){
$comments[$nid]['comments'] = comment_node_page_additions($node);
}
}
.....

nancydru’s picture

Status: Active » Needs review
StatusFileSize
new817 bytes

@mienjob: That seems to do the trick. Here's a regular patch.

emilyf’s picture

Status: Needs review » Reviewed & tested by the community

patch fixed the issue for me.

matt.rad’s picture

Fixed for me too. Thanks very much!

Anonymous’s picture

patch in #3 works well.
Thank you.

furamag’s picture

Patch in #3 works for me too. Please commit it to repository.

bendev’s picture

Patch in #3 works for me too. Please commit it to repository.

bendev’s picture

Issue summary: View changes

Just updated the formatting.

marcoka’s picture

will be commited to next version

marcoka’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Patch (to be ported)
marcoka’s picture

Version: 7.x-2.2 » 7.x-2.3
Assigned: Unassigned » marcoka
Status: Patch (to be ported) » Closed (fixed)
gge’s picture

This patch should be commited.

marcoka’s picture

Status: Closed (fixed) » Reviewed & tested by the community
marcoka’s picture

Status: Reviewed & tested by the community » Fixed

commited.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.