When a site search (search.module) is performed and a Protected Node is returned as part of the search, rather than displaying the list of nodes, protected_node fires off a redirect to the Password Protection---this prevents *any* search results from being returned.

One should be able to perform a search and have results returned without triggering the password.

CommentFileSizeAuthor
#3 protected_node_search_result.patch794 bytesramlev

Comments

Frank Steiner’s picture

I guess this shouldn't happen because no content is returned for the page when it is fetched from a cron run (although this doesn't work well), so that no content should ever be indexed. Hmm.

cyberwolf’s picture

Same issue here. Subscribing.

ramlev’s picture

Status: Active » Needs review
StatusFileSize
new794 bytes

I have made a patch, which fix the issue when trying to see search results when some of the nodes is password protected.

jadwigo’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #3 works.. a password protected node will still show the title but no text.

If you want to exclude the nodes from search results restricted search will offer a all or nothing solution

AlexisWilke’s picture

Status: Reviewed & tested by the community » Needs work

Interesting problem. 8-)

The search is fed empty data when the password is set on a node. However, if you create a node, the search indexes it, and then you add a password to that node, it obviously is going to be in the search index, no matter what.

Thinking about it, it seems that the db_rewrite_sql() is the solution for this one (and many others...)

See: #830016: db_rewrite_sql() misses protected nodes...

Thank you.
Alexis

AlexisWilke’s picture

Version: 6.x-1.4 » 6.x-1.5
Assigned: Unassigned » AlexisWilke

Okay, the hook_init() was the solution on this one. The other things did not directly help.

It is fixed in 6.x-1.x for now. I'll wait a little before publishing 1.6.

Thank you.
Alexis Wilke

AlexisWilke’s picture

Status: Needs work » Fixed

Meant to mark as fixed. 8-)

Status: Fixed » Closed (fixed)

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