"Failed to load custom filter." message (in green, not red) is reported when tried to create custom filter.

I've entered an custom filter directly into a table. When tried to edit it through the interface, "warning: Missing argument 3 for custom_spam_filter_operations() in /var/www/html/www.gewiss.si/sites/all/modules/spam/filters/custom/custom.module on line 449." is reported.

CommentFileSizeAuthor
#5 spam_module.patch1.28 KBluti
#1 diff.patch840 bytescoreyp_1
#3 spam_diff_22.patch1.25 KBluti

Comments

coreyp_1’s picture

Status: Needs review » Active
StatusFileSize
new840 bytes

error due to form api changes.

Well, assuming that this patch is applied, then this one should work...

coreyp_1’s picture

Status: Active » Needs review

forgot to change status

luti’s picture

StatusFileSize
new1.25 KB

coreyp_1, thanks.

I believe I've found another bug - after selecting one filter and execute disable, the following error comes up: "warning: Missing argument 3 for custom_spam_filter_operations() in .../spam/filters/custom/custom.module on line 449."

I think the first argument (form_state) is sufficient here (at least for this operation; or, it should be passed as a first argument, what is not the case here...). So, I've created a patch, which I am attaching.

This patch contains also 2 minor "cosmetic" corrections - I think that for consistency reason it is good that messages are all in the same manner: "Custom filter ### created/updated/disabled/deleted...".

Please review my patch. If form_state is can be) needed for some other case, the function call at line 439 shall be corrected instead (form state pushed in as a first argument).

luti’s picture

Maybe just another suggestion - custom filter weight explanation is a bit incomplete by my opinion.

According to this text, filter with weight -5 (lower = "lighter") is applied before filter with weight 5 (higher = "heavier").

But, shall this mean that both are applied, and the result of the second one overwrites the result of the first one (if yes, is it always or just in some cases, for example if both filters are "positive"...), or that the second one will be examined only if the first one doesn't recognize a post as a spam?

luti’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

I think I've found 2 more things that doesn't work - proposed patch is in attachment.

TBarregren’s picture

@coreyp_1
I've reviewed and tested your patch in #1. It works as expected and looks correct.

@LUTi
I've reviewed and tested your patch in #3. It works as expected and looks correct. To avoid confusion about which patch to apply, I suggest you amend coreyp_1's patch with yours instead of offering it as a separate one.

@LUTi
Shouldn't your patch in #5 be posted as a separate issue? See also #352179: bad "Not Spam" link.

luti’s picture

TBarregren, both my patches should be posted as separate issues, I know - but unfortunately I didn't have time to create separate issues, but just wanted to post them ASAP. I see many new issues being reported in last 2 days, which I've missed somehow all of them. I will certainly try to be better in 2009! ;-)

gnassar’s picture

Status: Needs review » Fixed

Committed patch in #1. Thank you.

Status: Fixed » Closed (fixed)

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