Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #7 .
Summary of Changes
Fixes the issue of apostrophes in article titles causing the title to be truncated in search results.
Resolves #7
Resolves joomla/joomla-cms#34724
The truncation issue occurs in the
prepareSearchContent()
function inSearchHelper
class.Work around is to not run titles through search preparation which truncates text around the search term. Titles are returned in full instead, which is the expected behavior for search results (a user wants to see the title of an article not an extract of the title).
Testing Instructions
Create articles with titles that contain and don't contain apostrophes:
"This title isn't ok"
"This title is ok"
"This isn't ok, this title really isn't ok"
Using com_search search page, search for the article using a keyword in the title or text eg ("ok")
Expected result
The search results should show the full article titles, with search term highlighted
"This title isn't ok"
"This title is ok"
"This isn't ok, this title really isn't ok"
Actual result
Before this patch the article title in the search results was truncated by one character for each apostrophe (in some cases the actual search term can be truncated, which is definitely not the expected behavior)
"This title isn't o" (truncated by 1 char)
"This title is ok" (not truncated)
"This isn't ok, this title really isn't" (truncated by 2 chars)
Documentation Changes Required
None