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

Jeremy - August 5, 2009 - 15:28
Status:active» fixed

Fixed:
http://drupal.org/cvs?commit=247178

#2

gnassar - August 6, 2009 - 04:58

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

gnassar - August 6, 2009 - 05:08
AttachmentSize
spam-540830-r0.patch 1.89 KB

#4

gnassar - August 6, 2009 - 14:11

OK, that's what I get for doing stuff so late. That was neither an unified diff nor was it against HEAD. Fixed.

AttachmentSize
spam-540830-r1.patch 2.23 KB

#5

Jeremy - August 6, 2009 - 14:45
Status:fixed» reviewed & tested by the community

Yes, your fix is _much_ better than my fix. I've applied it locally and tested, it works as designed.

#6

gnassar - August 6, 2009 - 17:43

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

gnassar - August 6, 2009 - 18:00
Status:reviewed & tested by the community» fixed

Committed: http://drupal.org/cvs?commit=247568

#8

System Message - August 20, 2009 - 18:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.