Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293850

Comment module renders "reply" and other links in search index/results

$
0
0

Updated: Comment #11

Problem/Motivation

Under some circumstances, comment reply links, other comment-related links, and comment forms are rendered into the search index and search results. They shouldn't be.

To reproduce:

1. Grant permission to anonymous/authenticated users to add comments [Try with just authenticated, or both.]

2. Add a node with comments enabled.

3. Search for 'reply' or 'register' or 'permalink'. Ideally, you should not find your node.

4. Search for something that is in the node. You should not see any reply/edit/delete/register links in the results or text from the comment form.

Note: Currently in Drupal 7.x:

a. If only Authenticated users can comment:
- If you have content without any comments, there is nothing bad happening. You don't see anything about adding comments when you search.
- If you add a comment to the content (and run cron to index), however, you do see the "reply delete" from the comment links in the search results page. This is true in 7 and 8.
- You cannot search for "reply" or "delete". So this is only a problem in the rendering of search results, and these are not getting into the index.

b. If Anonymous users can comment, in addition:
- "Reply" is actually added to the search index, along with "permalink". If anonymous users do not have the ability to add comments, then you don't get "Reply" in the search index, but assuming they have the ability to view comments, "permalink" is added to the index. [This means you can search for both "permalink" and "Reply"].

Proposed resolution

Make sure these links and text are not included when the Comment module renders comments for search indexing and search results.

Remaining tasks

User interface changes

API changes

Original report by @pwolanin

Seems that comment module does a poor job of implementing hook_node_update_index(). I see that the text "Log in or register to post comments" and "Permalink" are rendered into the text for the node as sent to the search index.

This is really a comment module bug, but it's only relevant to search, so marking it for search.module

Perhpas comment module needs an addition module (not just full/teaser) for comment_view_multiple()?


Viewing all articles
Browse latest Browse all 293850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>