Problem/Motivation

This issue is related to #2501757: Remove SafeMarkup::set in NodeSearch::prepareResults(). In manual testing on searching for keyword inside script tag in comment body returned no result but test file fails because keyword search does find keyword inside script tag.

Proposed resolution

???

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
(done, created initial patch) Create a patch Instructions
Manually test (with some tags other than script) Novice Instructions
figure out why the test results are different than the manual testing -

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 2551135-1.patch1.69 KBkgoel

Comments

kgoel created an issue. See original summary.

kgoel’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

This partial patch is from #2501757: Remove SafeMarkup::set in NodeSearch::prepareResults()-55 to show the work in the test coverage for returning the keyword inside the script tag. Testing manually for keyword inside script works as expected with #2501757: Remove SafeMarkup::set in NodeSearch::prepareResults()-55 but running test file on local returns the keyword inside the script tag.

Status: Needs review » Needs work

The last submitted patch, 2: 2551135-1.patch, failed testing.

yesct’s picture

Issue summary: View changes

as part of this issue, we should also test some tags besides just script.

jhodgdon’s picture

OK, I'm a bit confused here.

You're saying that if you do this manually:
- Add a comment to a node, with a script tag with "rainbow" in it, in Full HTML
- Run cron to index
- Search for "rainbow"

that the result if you test manually is "no results", but the result in this test apparently isn't?

kgoel’s picture

@jhodgdon, that is correct. If I test manually then there is no result for keyword search with keyword inside script tag but if I run SearchCommentTest.php locally then search does find keyword inside script tag which it shouldn't.

jhodgdon’s picture

Is it possible that in the test, instead of it being an actual tag, it is something like

<script>

that is getting into the source? In other words, some kind of double-escaping that is an artifact of how the information is saved in the comment in the test?

jhodgdon’s picture

Status: Needs work » Closed (works as designed)

I really think this is a non-issue. If the test doesn't match what happens in an actual site, then there is a problem with the test, not a Drupal bug or missing test coverage. Until proven otherwise, I'm closing this issue... See #7 for the probable problem with the test.