At "Administer >> Site configuration >> Spam" if you try to configure "Content to filter" your changes aren't saved. For example, you can't enable filtering of "story", "page" or "users" content. Thus, the spam filter is only able to filter comments.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 351141-spam-can-only-filter-comments.patch | 2.7 KB | coltrane |
| #1 | diff.patch | 1.16 KB | coreyp_1 |
Comments
Comment #1
coreyp_1 commentedgotta love the form api...
Comment #2
coltranePatch corrects problem but another solution that lets system_settings_form_submit() do the variable set and delete work is to alter the content filters to use the spam namespace prefix.
This has the added value of making spam_admin_settings_form_submit() obsolete. However, the filter_types variable becomes a serialized array when using system_settings_form_submit() instead of just a comma-separated string. But, I don't see any use of filter_types anyways ... and it should really be namespaced like the rest of Spam modules variables.
Thoughts?
Comment #3
coltraneMarked #355199: cannot turn on spam filter for any content types as a duplicate of this issue.
Comment #4
luti commentedcoltrane, what is the code in #2? I mean, where to put (use) it?
Comment #5
coltraneApproach in #2 rolled into a patch. Need feedback whether filter_types is used.
Comment #6
luti commentedcoltrane, it doesn't seem to work for me - whatever I select or deselect doesn't remain like that, but I always get the selections as before the update of this module.
Are you sure the whole spam_admin_settings_form_submit() function declaration shall be removed?! It was not so in your post above (#2)...
I have noticed in your patch that I have 1 more line between (lines 904 and 905 in my file):
and (lines 907 and 908 in my file):
which is (line 906 in my file):
$filter_types = is_array($filter_types) ? implode(',', $filter_types) : $filter_types;and it seems the content type selection works for me (at least, it remains selected as I do it, checking and unchecking certain types...).
Comment #7
gnassar commentedPatch in #5 confirmed. Nice job!
As for filter_types, a grep through the module tree finds nothing outside of those occurrences in spam.module, so seems safe to delete for now.
Committed.