? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
7 Nov 2015

This solves #8298

Create an article with title in Hebrew
ביו
then purge and run smartsearch indexer (I used snowball as indexer)
When done, enter the title in the search box (still in the indexer page):
screen shot 2015-11-06 at 17 31 15

we get

500 Illegal mix of collations for operation 'like' SQL=SELECT COUNT() FROM `#__finder_links` AS l INNER JOIN `#__finder_types` AS t ON t.id = l.type_id WHERE l.type_id = 4 AND l.title LIKE '%ביו%' OR l.url LIKE '%ביו%' OR l.indexdate LIKE '%ביו%' Illegal mix of collations for operation 'like' SQL=SELECT l.,t.title AS t_title FROM `#__finder_links` AS l INNER JOIN `#__finder_types` AS t ON t.id = l.type_id WHERE l.type_id = 4 AND l.title LIKE '%ביו%' OR l.url LIKE '%ביו%' OR l.indexdate LIKE '%ביו%' LIMIT 0, 20 Illegal mix of collations for operation 'like' SQL=SELECT COUNT() FROM `#__finder_links` AS l INNER JOIN `#__finder_types` AS t ON t.id = l.type_id WHERE l.type_id = 4 AND l.title LIKE '%ביו%' OR l.url LIKE '%ביו%' OR l.indexdate LIKE '%ביו%' Illegal mix of collations for operation 'like' SQL=SELECT COUNT() FROM `#__finder_links` AS l INNER JOIN `#__finder_types` AS t ON t.id = l.type_id WHERE l.type_id = 4 AND l.title LIKE '%ביו%' OR l.url LIKE '%ביו%' OR l.indexdate LIKE '%ביו%'

the issue comes from the fact that the search query includes the indexdate while it is anyway useless here.
See: http://stackoverflow.com/questions/18629094/illegal-mix-of-collations-for-operation-like-while-searching-with-ignited-data for explanation.

After getting the 500, logout, login again and patch.
try again.
You should get :
screen shot 2015-11-07 at 08 58 21

avatar infograf768 infograf768 - open - 7 Nov 2015
avatar infograf768 infograf768 - change - 7 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2015
Labels Added: ?
avatar pe7er pe7er - test_item - 7 Nov 2015 - Tested successfully
avatar pe7er
pe7er - comment - 7 Nov 2015

I have tested this item :white_check_mark: successfully on bf3c49e

I was able to reproduce the error. This PR fixes it. Thanks JM!


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

avatar dgt41 dgt41 - test_item - 7 Nov 2015 - Tested successfully
avatar dgt41
dgt41 - comment - 7 Nov 2015

I have tested this item :white_check_mark: successfully on bf3c49e


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

avatar infograf768 infograf768 - change - 7 Nov 2015
Category Administration Components
avatar infograf768 infograf768 - change - 7 Nov 2015
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 7 Nov 2015

2 good test: RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 7 Nov 2015
Milestone Added:
avatar wilsonge
wilsonge - comment - 7 Nov 2015

@infograf768 if you just remove the like rather than the whole query does it work? Iirc you can't use LIKE for a database date time object. And it would still allow filtering by date for those who want it (sorry travelling on a train so can't test myself to see if it would work)

avatar infograf768
infograf768 - comment - 7 Nov 2015

@wilsonge
We just do not need that query there. No need to go further imho.

avatar infograf768
infograf768 - comment - 7 Nov 2015

I meant we do not need ' OR l.indexdate LIKE ' . $search which is only part of the query

avatar infograf768
infograf768 - comment - 7 Nov 2015

oh, you mean just letting `' OR l.indexdate'). Hmm...
I do not see how anyone would need that in the back-end search...

avatar wilsonge
wilsonge - comment - 7 Nov 2015

I mean like OR l.indexdate = $search yeah

I'm not sure either. But if there is a use case at least it would still work?

avatar infograf768
infograf768 - comment - 7 Nov 2015

If someone hacks core admin it is his/her problem

avatar wilsonge
wilsonge - comment - 7 Nov 2015

It's not a hack! This is a thing that can be used at the moment?

avatar infograf768
infograf768 - comment - 7 Nov 2015

The only way to keep a search by date is to preg_match $search to make sure it does not contain unicode characters.
One can indeed search by 2015-11-07 in that case and this whatever the date format for the language used in back-end (in French the column would show 7/11/15 but it would not fit the indexdate in the column.
I doubt anybody would have ever used that in the Indexer page...
Anyway, this would work

        // Check the search phrase.
        if ($this->getState('filter.search') != '')
        {
            $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($this->getState('filter.search')), true) . '%'));

            // Do not filter by indexdate if $search contains non-ascii characters
            if (preg_match('/[^\x00-\x7F]/', $search))
            {
                $query->where('l.title LIKE ' . $search . ' OR l.url LIKE ' . $search);
            }
            else
            {
                $query->where('l.title LIKE ' . $search . ' OR l.url LIKE ' . $search . ' OR l.indexdate LIKE  ' . $search);
            }
        }

Would you be satisfied with this?

avatar joomla-cms-bot
joomla-cms-bot - comment - 7 Nov 2015

This PR has received new commits.

CC: @dgt41, @pe7er


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

avatar fontanil fontanil - test_item - 8 Nov 2015 - Tested successfully
avatar fontanil
fontanil - comment - 8 Nov 2015

I have tested this item :white_check_mark: successfully on 00f2a62

Tested on 3.5.0 beta1: successfull on date and unicode. Thanks


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

avatar infograf768
infograf768 - comment - 9 Nov 2015

@dgt41, @pe7er, @wilsonge
One test more please to get this in.

avatar waader waader - test_item - 9 Nov 2015 - Tested successfully
avatar waader
waader - comment - 9 Nov 2015

I have tested this item :white_check_mark: successfully on 00f2a62

Thanks,infograf768!


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

avatar rdeutz rdeutz - reference | 1d3a872 - 9 Nov 15
avatar rdeutz rdeutz - merge - 9 Nov 2015
avatar rdeutz rdeutz - close - 9 Nov 2015
avatar rdeutz rdeutz - close - 9 Nov 2015
avatar joomla-cms-bot joomla-cms-bot - close - 9 Nov 2015
avatar rdeutz rdeutz - change - 9 Nov 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-11-09 07:57:14
Closed_By rdeutz
avatar joomla-cms-bot joomla-cms-bot - change - 9 Nov 2015
Labels Removed: ?
avatar ertinet
ertinet - comment - 9 Nov 2015

Thank you all for your assistance
We've tested it and it work perfectly

Thanks and Regards
Rose ERTINET

avatar infograf768 infograf768 - head_ref_deleted - 9 Nov 2015

Add a Comment

Login with GitHub to post a comment