Word Filter does not filter words when using views
sped2773 - August 27, 2008 - 16:41
| Project: | Wordfilter |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
For example, using views 2 to create a most recent comments, this could include the comment title and a snippet of the comment body the excluded words will still appear in the view.

#1
I haven't played around with Views 2 enough but I would suspect
that this is because Views does not call node_load or comment_load
to get node/comment data but rather retrieves content directly
from the database. This means that the Drupal hooks for
hook_nodeapi and hook_comment are not run.
Wordfilter works by filtering node and comment titles and content
when the relevant hook_nodeapi or hook_comment Drupal
hooks are run ('load' or 'view' operations) and so are not going
to filter on content loaded outside of the standard Drupal
hooks.
I guess I'll have to look into Views pre/post processing of fields
to see what can be done there if anything.
#2
ok looks like we can hook in word filtering for views with
hook_views_pre_view(). Views results in Full Node and
Teaser View already get filtered via the standard Drupal
hooks but not List and Table view.
Will get this working and add it to the module.
#3
still looking for the new Views 2 hooks to do this. The method
that works in Views 1 does not work here.