? Success
Related to # 5269

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
4 Dec 2014

See #5269

This fixes an SQL error in finder, where the weight is formatted as a locale aware float. When converting a float to a string in PHP, it unfortunately is formatted according to the locale setting. For Germany that means, that a 0.6 float becomes a "0,6" string. That breaks MySQL and is also not parsed by MySQL even when quoted. Using number_format(), we can get around that. However we are truncating the number to 2 digits after the decimal point.

Since I only fixed the code, I don't know how to test this. :wink: maybe @marneu can give testing instructions?

Since this problem is also present in the other database drivers, I will apply this patch there, too.

avatar Hackwar Hackwar - open - 4 Dec 2014
avatar jissues-bot jissues-bot - change - 4 Dec 2014
Labels Added: ?
avatar Hackwar
Hackwar - comment - 4 Dec 2014

done

avatar brianteeman brianteeman - change - 4 Dec 2014
Rel_Number 5269
Relation Type Related to
avatar marneu
marneu - comment - 4 Dec 2014

Test done on 3.3.6: works fine, seems save, result as expected in mysql - Thanks!

avatar waader
waader - comment - 4 Dec 2014

@marneu How did you test this? I would follow your procedure for mssql and postgresql.

avatar marneu
marneu - comment - 4 Dec 2014

@waader: On a recent debian apache2 installation using php5-fpm within de_DE.utf8 enviroment and mysql charset is an (old) latin1.

  • Modified the existing installation in administrator/components/com_finder/helpers/indexer/driver/mysql.php on line 602 as the patch shows
  • modified an article in the Joomla website (no more error occured)
  • checked the entries in the sql database

btw: The error occured after switching to php5-fpm from only using fastcgi before.

avatar marneu
marneu - comment - 4 Dec 2014

@waader: btw patch_tester, just seen, nice tool! I will give it a try soon...

avatar waader
waader - comment - 4 Dec 2014

@marneu: you can download the current source and there you will find a build script that generates a installable file of com_patchtester. The current beta version is rather old.

avatar waader
waader - comment - 4 Dec 2014

I am unable to test this currently as I am always testing against the current staging branch and com_finder seems to be broken (see screenshoot). Steps to reproduce:

  • vanilla installation of current stage branch with test sample data and mysql or postgresql
  • enable pluging "Smart Search - content"
  • index in "Components" -> "Smart Search" j33staging_finder
avatar marneu
marneu - comment - 5 Dec 2014

@waader: I'm going to do another/new setup beginning of the upcomming year and am going to use a non distrubion (i.e. github) stable branch with the debian underlaying setup. Is that what would be helpful to you?
greets Markus

avatar waader
waader - comment - 5 Dec 2014

@marneu I don´t need help here, that´s not the point. I am just saying that I am always testing from latest staging as in my mind there is not much value in testing a patch with an old version. On the other side: there are a lot of patches marked as ready to commit and from browsing over them it could be that after merging them the problem that I am facing right now disappears.

So I will wait for that merge to happen and then revisit this pull request.

avatar brianteeman brianteeman - change - 6 Dec 2014
Category Search
avatar roland-d
roland-d - comment - 6 Sep 2015

@waader Could you please revisit this and test the proposed fix? Thank you.

avatar Hackwar Hackwar - change - 6 Jan 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-01-06 11:31:40
Closed_By Hackwar
avatar Hackwar Hackwar - close - 6 Jan 2016

Add a Comment

Login with GitHub to post a comment