Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #7 #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

zzella
Copy link

@zzella zzella commented Apr 4, 2022

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 in SearchHelper 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

Fixes the issue of apostrophes in an article titles causing the title to be truncated in search results. 
Resolves joomla-extensions#7 (joomla-extensions#7)
Resolves joomla/joomla-cms#34724 (joomla/joomla-cms#34724)
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

last letter truncated in the titles of search results Search Result is Stripping Characters
1 participant