-
Notifications
You must be signed in to change notification settings - Fork 6
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
last letter truncated in the titles of search results #7
Comments
This happens when there is an apostrophe in the title. The article title returned by com_search is truncated by the number of apostrophes in the title. The letters are stripped in the search helper prepareSearchContent() function which calls _smartSubstr(). The prepareSearchContent() function is intended to return a substring which contains the search word. This makes sense to return a relevant extract from the article, but doesn't make sense on for the title. A title should just be returned in full, allowing the template to truncate it for length if necessary. Proposed solution: |
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).
Hi, I have tested it successfully :) |
Steps to reproduce the issue
I thought it was a template bug and I reported the problem to Yootheme but the support verified that even with the Cassiopea template the code output is incorrect and for this reason the title is shown without the last letter.
I try to change template in Cassiopea and the problm is the same.
The problem does not happen with short titles
Expected result
Titles in search results must be integers
Actual result
The last character of the search results title with a long title is deleted
System information (as much as possible)
Joomla 4.0.5
PHP 7.4.27
db mysql 10.3.32-MariaDB-cll-lve
Additional comments
You che see the problem on this page where first result have a title without the last character.
If you open the article you will see that the last word has an extra letter.
The text was updated successfully, but these errors were encountered: