Bug in Joomla 3.7.3, 3.7.4: Highlighting of the search word in the title of a search result does not work

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
MaiklE
Joomla! Apprentice
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

Post by MaiklE » Wed Jul 26, 2017 11:01 pm

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?
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

User avatar
brian
Joomla! Master
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

Post by brian » Thu Jul 27, 2017 4:04 pm

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/

MaiklE
Joomla! Apprentice
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

Post by MaiklE » Fri Aug 18, 2017 11:39 am

I have just updated to 3.7.5. The bug remains.

Trigully
Joomla! Apprentice
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

Post by Trigully » Fri Aug 18, 2017 11:45 am

Same bug here

User avatar
brian
Joomla! Master
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

Post by brian » Fri Aug 18, 2017 11:50 am

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.
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

Trigully
Joomla! Apprentice
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

Post by Trigully » Fri Aug 18, 2017 11:55 am

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 :)

MaiklE
Joomla! Apprentice
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

Post by MaiklE » Fri Aug 18, 2017 12:31 pm

Thanks, Brian.

Trigully
Joomla! Apprentice
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

Post by Trigully » Fri Aug 18, 2017 12:32 pm

I found a shortcut here - fixed my problems for a little while
https://github.com/joomla/joomla-cms/issues/16979

User avatar
brian
Joomla! Master
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

Post by brian » Fri Aug 18, 2017 12:41 pm

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/


Locked

Return to “Joomla! 3.x Bug Reporting”