Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Notice: Undefined property: stdClass::$mail in comment_notify_comment_insert() (line 264 of /comment_notify/comment_notify.module).
Comments
Comment #1
anewman1980 CreditAttribution: anewman1980 commentedI receive nearly the same error in 7.x-1.x-dev
Notice: Undefined property: stdClass::$mail in comment_notify_comment_insert() (line 263 of /comment_notify/comment_notify.module).
The issue seems to occur whenever an email address for the anonymous user is not set, even if an email address is not requested. It happens whether the permission to allow anonymous users to subscribe is set or not. The only way around this currently is to force the anonymous user to provide an email address, which is probably not the best solution (this is done in content type settings).
Comment #2
sirkitree CreditAttribution: sirkitree commentedseeing this as well. verified that actually putting in an email address fixes this. Note that this also happens even if you do not check the "Notify me when new comments are posted" box.
Comment #3
pixelsweatshop CreditAttribution: pixelsweatshop commentedComment #4
JohnAlbinComment #5
gregglesSo, this module used to use the mail and the cid as the basis of the hash. But those are not always available. I was using them basically for legacy reasons, but I don't think there's any reason to do that.
So, two patches: one that still uses the mail as the basis still but uses a brand new password (which seemed like a decent thing...) otherwise.
One that just uses a brand new password.
Thoughts? Should I use something other than a random password?
Comment #6
gregglesThis should ideally get a backport.
Comment #7
Dave ReidHrm, I know $comment->hostname is always available, but it may not necessarily be unique. Maybe add in $comment->created?
Comment #8
gregglesGreat, that works for me. It's not super unique but the cid is pretty unique.
http://drupalcode.org/project/comment_notify.git/commit/d4404ec
Comment #9
Jiri Volf CreditAttribution: Jiri Volf commentedTried the patched version from git and also dev version from 20.7, and when submitted a comment(checked notify and provided an email address) - got Notice: Undefined property: stdClass::$hostname on 259
tried inserting token [comment:hostname] in the email form in comment notify settings - and when posted a new commnent to the same thread, it did not show up in the email and I got:
Notice: Undefined property: stdClass::$hostname ve funkci comment_tokens() (řádek: 131 v souboru /data/web/virtuals/1198/virtual/www/modules/comment/comment.tokens.inc).
When I tried other tokens in the email template - like [comment:cid] or [comment:created] - it got replaced correctly appeared in the incomming email.
I am still on drupal 7.0, not sure it this could be the problem.. Once i update it, will try again. I am using the latest token 7.x-1.0-beta2
update: changed my username from vlx to Jiri Volf
Comment #10
gregglesThanks for the information vlx. I couldn't repeat that behavior myself, I wonder if you have a slightly different configuration somewhere? My site is a pretty basic Drupal 7 installation.
Comment #11
gregglesFor now let's move the discussion on the issue in #9 to #1224958: Notice: Trying to get property of non-object line 418 comment_notify.module.
Comment #12
jec006 CreditAttribution: jec006 commentedI've updated the patch to make it work with drush (for the purpose of using it in a make file)
Thanks
#fail, posted the wrong one... trying again
Comment #13
jec006 CreditAttribution: jec006 commentedretry
Comment #14
gregglesThe comment in #9 that claimed this was a problem referred to a separate issue - http://drupal.org/node/1224958#comment-4785218
In that separate issue he says he upgraded to 7.4 and the problem is gone, so perhaps this was a problem with earlier versions of core?
I feel more confident in this now.