Node_age spam filter reports nid when none exists
Jeremy - August 5, 2009 - 15:24
| Project: | Spam |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Jeremy |
| Status: | closed |
Description
The following log is confusing:
node_age_spam_filter, retrieved nid () from database
This message should only be displayed if a nid was actually retrieved from the database.

#1
Fixed:
http://drupal.org/cvs?commit=247178
#2
Seems like by the code gets to that point, there should never be a case where a nid cannot be recovered.
Most likely case that would happen is where the content type isn't a comment -- so shouldn't that be checked for first?
The fix I have (and have been testing on my site) does that, as well as more accurately describes the errors at each if, upping severity to SPAM_VERBOSE if something that "shouldn't happen" happens. I'll re-roll that against the current changed HEAD and post in just a minute so you can take a look and see what you think.
#3
#4
OK, that's what I get for doing stuff so late. That was neither an unified diff nor was it against HEAD. Fixed.
#5
Yes, your fix is _much_ better than my fix. I've applied it locally and tested, it works as designed.
#6
Great. I'll commit as soon as I get comments on #532158: Consistent logging across modules to make the patch compliant with the proposed logging settings there.
#7
Committed: http://drupal.org/cvs?commit=247568
#8
Automatically closed -- issue fixed for 2 weeks with no activity.