I get the following notice whenever I approve a comment:

Undefined property: stdClass::$notify_type in comment_notify_comment_update() (line 254 of/home/tgeller/webapps/tomgeller/sites/all/modules/comment_notify/comment_notify.module).

Any ideas?

CommentFileSizeAuthor
#8 1354990_less_notice.patch872 bytesgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scottrigby’s picture

Status: Active » Closed (duplicate)

@tgeller: have you tried 7.x-1.x-dev? It looks like http://drupalcode.org/project/comment_notify.git/commit/8e1ca98 may have fixed this issue. It seemed to in my case, so marking as a duplicate of #1224958: Notice: Trying to get property of non-object line 418 comment_notify.module unless you find otherwise

tgeller’s picture

Thanks, Scott. I haven't tried -dev; I'll report if it's still a problem with the next stable version.

Dimetrius’s picture

+ 1 I have the same error

harriska2’s picture

Same here and I'm using the dev version. It happens with an anonymous user clicking on "all comments" or "replies to my comment." Email doesn't send to the anonymous user but it does send to others. Anonymous is set to give email in comments.

chriscohen’s picture

Status: Closed (duplicate) » Active

Confirmed that the dev version does not fix this issue. It's actually pretty clear that it doesn't, since the lines in question haven't been altered, and nothing else affects that behaviour that has been committed to dev!

I don't think it would take much to fix this, as it's just a failure to check whether a value is set.

mermentau’s picture

Confirming that this issue is still alive with the latest dev dated May 14, 2012. It is shown when comments are published or unpublished in /admin/content/comment The anonymous commenter does get notified though.

greggles’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review

I think this was more of an annoyance than anything, but it definitely wasn't great.

Here's a patch that I think works. It's a little tricky to review because this code affects create, editing, and publishing of comments so you have to test a lot of scenarios. I don't plan to commit this until after the next release because it has the possibility of introducing weird, hard to find bugs.

greggles’s picture

FileSize
872 bytes

and I forgot the patch. ugh.

Here it is.

willkaxu’s picture

Clean install Drupal 7.14 and Comment Notify 7.x-1.x-dev, greggles's patch works well! Thanks!

greggles’s picture

Title: Error on approving comments: "Undefined property: stdClass::$notify_type" » Error on approving comments: 'Undefined property: stdClass::$notify_type'
Status: Needs review » Fixed

Ok, now committed http://drupalcode.org/project/comment_notify.git/commit/ed08170 to help get testing in the dev branch.

Status: Fixed » Closed (fixed)

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

OddJob’s picture

I received the same error. I can also confirm that either applying the patch or installing the 7.x Dev version of the module (Aug 14) resolved the issue. I applied the patch first. Then in a clean install of Drupal 7 I installed the Dev version. In both cases the error did not reoccur.

I also ran coder against the module. I posted the findings under open issues.