?
avatar Vmadmax
Vmadmax
25 Jul 2017

Steps to reproduce the issue

Use search box to find keyword in title

Expected result

Original title from content

Actual result

Lowercase word in title, if it is highlighted

System information (as much as possible)

Joomla 3.7.3

Additional comments

It's this line in /components/com_search/views/view.html.php
$result->title = StringHelper::str_ireplace($needle, $hl1 . $needle . $hl2, htmlspecialchars($result->title, ENT_COMPAT, 'UTF-8'));

You don't have to use str_ireplace here.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar Vmadmax Vmadmax - open - 25 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jul 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Jul 2017
Category com_search
avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Jul 2017
Status New Confirmed
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Jul 2017

Issue confirmed.

Searched for "Sample Sites", got:
screen shot 2017-07-25 at 13 07 30

System information

3.7.4-dev (latest nightly build)
Multilanguage Site
macOS Sierra, 10.12.5
Firefox 54 (64-bit)

MAMP 4.1.1

  • PHP 7.0.15
  • MySQLi 5.6.35

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17241.
avatar tonypartridge
tonypartridge - comment - 26 Jul 2017

Personally I don't see it as an issue since I wouldn't know if a word was or was not capitalised when searching I would want all results.

I suppose given the usuage case, another option could be added for case sensitive searching.

avatar brianteeman
brianteeman - comment - 27 Jul 2017

For me this is a bug that should be fixed. its not about the search but the search results

avatar Vmadmax
Vmadmax - comment - 27 Jul 2017

For me it's a bug.
In german, it's often that you have many uppercase words. It's a spelling mistake, it doesn't look good for the user and it's wrong.

I think, you have to search for lower and uppercase, but don't print out the highlighted words in lowercase. It should be the original.

avatar brianteeman
brianteeman - comment - 27 Jul 2017

I agree and i would fix it if i could

avatar tonypartridge
tonypartridge - comment - 27 Jul 2017

Ok I have a partial fix, but the problem is the whole search has been coded to force lower, it lowers the title and result. So now the highlighting is messed up. In turn it looks like StringHelper::substr_replace isn't actually working either! since it should be able to replace StringHelper::str_ireplace without any changes, yet it fails as it never finds a match.

avatar INOSIM
INOSIM - comment - 27 Jul 2017

@tonypartridge There seems to be a misunderstanding about the issue. Searching for e.g. joomla and finding joomla, Joomla or JOOMLA is good but searching for joomla and having all title results highlighted as joomla when they originally were Joomla or JOOMLA is the bug.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17241.

avatar tonypartridge
tonypartridge - comment - 27 Jul 2017

@INOSIM not according to @brianteeman and @Vmadmax there issue is it's finding all cases. Which is right in different languages.

I'm fixing the replacement to soon, we use ireplace but this doesn't support case sensitive so I'll have to move it to preg_replace.

avatar brianteeman
brianteeman - comment - 27 Jul 2017

No I am happy that the search is insensitive. The bug is that when the term
is highlighted then it is transformed to be displayed as lowercase

On 27 Jul 2017 12:53 p.m., "Tony Partridge" notifications@github.com
wrote:

@INOSIM https://github.com/inosim not according to @brianteeman
https://github.com/brianteeman and @Vmadmax https://github.com/vmadmax
there issue is it's finding all cases. Which is right in different
languages.

I'm fixing the replacement to soon, we use ireplace but this doesn't
support case sensitive so I'll have to move it to preg_replace.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#17241 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8ZrknP-lDnSPWB_iB0-Ys_1iNlF8ks5sSHpNgaJpZM4Oigmz
.

avatar tonypartridge
tonypartridge - comment - 27 Jul 2017

Ahhh! ? will change the PR

On 27 Jul 2017, 13:02 +0100, Brian Teeman notifications@github.com, wrote:

No I am happy that the search is insensitive. The bug is that when the term
is highlighted then it is transformed to be displayed as lowercase

On 27 Jul 2017 12:53 p.m., "Tony Partridge" notifications@github.com
wrote:

@INOSIM https://github.com/inosim not according to @brianteeman
https://github.com/brianteeman and @Vmadmax https://github.com/vmadmax
there issue is it's finding all cases. Which is right in different
languages.

I'm fixing the replacement to soon, we use ireplace but this doesn't
support case sensitive so I'll have to move it to preg_replace.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#17241 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8ZrknP-lDnSPWB_iB0-Ys_1iNlF8ks5sSHpNgaJpZM4Oigmz
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar INOSIM
INOSIM - comment - 27 Jul 2017

@tonypartridge First off, thanks for working on the replacement issue. But on the case-sensitive search issue, @brianteeman said "its not about the search but the search results" and @Vmadmax "I think, you have to search for lower and uppercase, but don't print out the highlighted words in lowercase. As a german, it's not strange to be lazy and search for a word all lowercase but it looks like a typo when the result is lowercase when it normally would be written Uppercase.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17241.

avatar tonypartridge
tonypartridge - comment - 27 Jul 2017

PR now in guys:
#17303

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jul 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-07-27 13:46:14
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 27 Jul 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 27 Jul 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Jul 2017

closed as having PR #17303


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17241.

Add a Comment

Login with GitHub to post a comment