Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow up on #1009234: Notices on line 118 of Bayesian filter was talked a lot about the one problem in the Bayesian filter.
The following are E_NOTICE errors I got when marking a spam comment as spam in the comments approval queue.
* notice: Undefined index: score in .../drupal/sites/all/modules/spam/spam.module on line 1729.
* notice: Undefined variable: extra in .../drupal/sites/all/modules/spam/content/spam_content_comment.inc on line 217.
* notice: Undefined index: tokens in .../drupal/sites/all/modules/spam/filters/spam_filter_bayesian/spam_filter_bayesian.module on line 182.
* notice: Undefined index: gzcjzmfemqbu.com in .../drupal/sites/all/modules/spam/filters/spam_filter_url/spam_filter_url.module on line 176.
* notice: Undefined index: total in .../drupal/sites/all/modules/spam/filters/spam_filter_url/spam_filter_url.module on line 177.
* notice: Undefined index: sxcoifylsmzg.com in .../drupal/sites/all/modules/spam/filters/spam_filter_url/spam_filter_url.module on line 176.
* notice: Undefined index: qtxemrxrunqc.com in .../drupal/sites/all/modules/spam/filters/spam_filter_url/spam_filter_url.module on line 176.
* notice: Undefined index: vhjilbolhptn.com in .../drupal/sites/all/modules/spam/filters/spam_filter_url/spam_filter_url.module on line 176.
* notice: Undefined index: redirect in .../drupal/sites/all/modules/spam/spam.module on line 1751.
* notice: Undefined index: comments in .../drupal/sites/all/modules/spam/content/spam_content_comment.inc on line 274.
Thank you.
Alexis Wilke
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedNot seeing this.
Comment #2
AlexisWilke CreditAttribution: AlexisWilke commentedFix for the URL filter:
http://drupalcode.org/project/spam.git/commit/5507a15
It would do this:
The ++ accesses an undefined entry the first time the URL is found.
Thank you.
Alexis Wilke
Comment #3
AlexisWilke CreditAttribution: AlexisWilke commentedFix for the 'redirect' index:
http://drupalcode.org/project/spam.git/commit/51e1bd5
Somehow all the other parameters used were checked with isset() but not 'redirect'...
Thank you.
Alexis Wilke
Comment #4
AlexisWilke CreditAttribution: AlexisWilke commentedFixed the comment notice:
http://drupalcode.org/project/spam.git/commit/0c66a1c
The same function is used whether it is creating the Comment form with the list of comments or whether it is checking the posted data. In the former the form does not include the $form_state['post']['comments'] which needs to be checked with isset() and not is_array(). (we could also check with empty() and avoid the loop when empty...)
Thank you.
Alexis Wilke
P.S. marking as fixed. The first 3 notices posted here were already gone in 6.x-1.x including the latest killes check-ins (but it probably was fixed from before killes latest changes.)