When searching for a product in 1.9.3, every product comes up in the list in fulltext mode.
How do I fix that issue ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityEdit: this is not the only 1.9.3.0 bug. See this answer for details and a module that fixes all the bugs: https://magento.stackexchange.com/a/140826/2380
This is a bug.
Thanks to IWeb for developping the fix available here: https://gist.github.com/balloz/d526e7dbe14c295d706be748e294c8a4
So here's the steps to take to fix the bug:
First, copy app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php
to app/code/local/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php
Then do the following:
Replace line 132:
$this->getSelect()->orWhere('FALSE');
With:
$this->getSelect()->where('FALSE');
Then copy app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php
to app/code/local/Mage/CatalogSearch/Model/Resource/Fulltext.php
And do the following:
After this code line 350:
if ($like) {
$likeCond = '(' . join(' OR ', $like) . ')';
}
You need to add a closing bracket by adding:
}
Then after this code line 383:
$this->_foundData = $adapter->fetchPairs($select, $bind);
You need to remove the closing bracket:
}
Edit: thanks to Jacques from Monsieur Biz here's a "clean" patch (which creates automatically the fixed file under app/code/local
: https://gist.github.com/jacquesbh/c6283faab001d724806c1639a821ff7c
NB: be careful if you ever applied the AND operator this the resource model (as described here: http://markustenghamn.com/improve-search-function-magento), the patch may fail and/or you may have to reapply the AND operator description)