Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
Moderator: ooffick
Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
-
- Joomla! Apprentice
- Posts: 6
- Joined: Wed Apr 26, 2017 7:29 pm
Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
There is a bug in Joomla 3.7.3 that has not been fixed in 3.7.4: the standard Joomla search component does not highlight the search word correctly in the title of a search result. If there is a match in the title, instead of the yellow highlight it shows <span class="highlight">search keyword</span> in the title of the search result. It also interprets incorrectly special symbols appearing in the title of a search result - for instance, " instead of ".
If line 270
$result->title = StringHelper::str_ireplace($needle, $hl1 . $needle . $hl2, htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8'));
in the file components/com_search/views/search/view.html.php is commented out, the title highlighting is deactivated and the problem with the special symbols disappears.
Is there a better solution that keeps the title highlighting?
If line 270
$result->title = StringHelper::str_ireplace($needle, $hl1 . $needle . $hl2, htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8'));
in the file components/com_search/views/search/view.html.php is commented out, the title highlighting is deactivated and the problem with the special symbols disappears.
Is there a better solution that keeps the title highlighting?
Last edited by toivo on Thu Jul 27, 2017 9:47 pm, edited 2 times in total.
Reason: mod note: moved, not related to Performance
Reason: mod note: moved, not related to Performance
- brian
- Joomla! Master
- Posts: 12785
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
This has now been fixed in the core for the next release
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
-
- Joomla! Apprentice
- Posts: 6
- Joined: Wed Apr 26, 2017 7:29 pm
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
I have just updated to 3.7.5. The bug remains.
-
- Joomla! Apprentice
- Posts: 19
- Joined: Thu Dec 22, 2011 12:50 pm
- brian
- Joomla! Master
- Posts: 12785
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
Sorry for my incorrect comment before .
The problem is that you have a template override for the search that has not been updated to support search highlighting in the title. You should contact your template provider for an update.
You can confirm that it is a problem with your template by temporarily switching to use protostar and you will see that highlighting of the search term works correctly.
The problem is that you have a template override for the search that has not been updated to support search highlighting in the title. You should contact your template provider for an update.
You can confirm that it is a problem with your template by temporarily switching to use protostar and you will see that highlighting of the search term works correctly.
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
-
- Joomla! Apprentice
- Posts: 19
- Joined: Thu Dec 22, 2011 12:50 pm
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
Okey, I was afraid of that - my template has not been updated since 2016. I just checked my other site with a newer template, noe issue there.
Means I have to work faster changing my template. Thank you Brian
Means I have to work faster changing my template. Thank you Brian
-
- Joomla! Apprentice
- Posts: 6
- Joined: Wed Apr 26, 2017 7:29 pm
-
- Joomla! Apprentice
- Posts: 19
- Joined: Thu Dec 22, 2011 12:50 pm
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
I found a shortcut here - fixed my problems for a little while
https://github.com/joomla/joomla-cms/issues/16979
https://github.com/joomla/joomla-cms/issues/16979
- brian
- Joomla! Master
- Posts: 12785
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work
That doesnt solve the real problem which was that search terms were not being highlighted in the title. Far better to fix the template than to hack joomla
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/