Posted by fubarthepanda on May 14, 2008 at 4:53am
| Project: | Wordfilter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Not sure if this is a bug or a feature request (reclassify at will), but filtering doesn't appear to be working on node titles when they show up in search results using Drupal's built-in search module. The body text snippet displayed in the search results is filtered appropriately, but the node title appears unfiltered.
Regardless, great module!
Comments
#1
Okay it works on a quick test for me. The node in question that
you are testing - was it created (and likely indexed by search)
prior to installing/updating wordfilter to the current development
version?
If the node was already indexed then it will not have picked up
the (new) feature of filtering on node titles.
Can you try creating a new node with words that will be
filtered, run cron to update the index then check the
search results to verify your issue?
#2
jaydub,
Thanks for the quick response!
After re-indexing, the node titles appear to filtering correctly in the search results.
However, the comment title/subjects are not filtering (but the comment bodies are).
So, in summary, when you view the comment on the related node page, both the comment title/subject and the body filters correctly, but when that same comment shows up in the search results, only the body is filtering.
#3
took a look and unfortunately drupal core comments module
updates the search index to add comments to a node when
the 'update status' operation is invoked on hook_nodeapi.
core comments loads the comment subject and body directly
from the comments table when a node updates it's index via
hook_nodeapi. So there is no way to filter the comments
prior to inserting in the search index. We can however filter
the search results although this means that we are filtering
the node twice, once on noad nodeapi 'load' and again on
node nodeapi 'search result'.
I wanted to post a patch here but damn damn the access to
sites outside of China is just not happening today :( The govt
seems to want to just cut off as much access as they can
so I am having trouble getting to drupal CVS.
#4
jaydub,
Thanks again for the quick response!
When you're able to post the patch -- I'll definitely test it out for you asap.
Keep me posted.
#5
ok let's try attaching the patch now :)
#6
jaydub,
I applied the patch.
Prior to the patch, the search results were displaying the node title along with the comment title and comment teaser with the comment title unfiltered and the comment teaser filtered.
After the patch, the search results are displaying the node title and the node body teaser (i.e. the comment title and teaser are no longer displaying). If you click on the node title, you can obviously see the comment title and teaser, which are both correctly filtered.
Let me know if this matches your expectations.
Thanks again!
#7
Ok I committed this patch to CVS. It's not the best possible solution
but short of modifying core to allow for the wordfilter filter to be
run, this is the next best thing.
#8
Thanks again, jaydub!
#9
Automatically closed -- issue fixed for two weeks with no activity.