I have a new install of joomla 1.7 and the latest release of VM RC2G and that version's modules. I installed the sample virtuemart products.
The search module removes spaces in the search string. For example, if you search for the "hand shovel" it combines the word to "handshovel" and produces no results. Same thing with the "nice saw", it changes it to "nicesaw".
I was also hoping the new virtuemart search would have the ability to search for plurals? For example, a search for "shovels" returns no results, but there are many shovels in the vm sample products. (a search for "shovel" returns all the correct results).
Thanks
ahh okey, the first thing is indeed interesting, this happens due security feature.
The other thing I must neglect, we are not gooogle :-)
The search removing spaces still happens in the latest version subrelease H.
Is there something I should be doing to fix this? Or should I just be more patient until the final release? 8)
Why in /administrator/components/com_virtuemart/models/product.php developers used JRequest::getWord?
JRequest::getString method is also safe.
Quote from: api.joomla.orgFetches and returns a given filtered variable. The string filter deletes 'bad' HTML code, if not overridden by the mask.
upd: unicode support is need for $keyword, not for $search.
And you're right, if($search=='true') really can be deleted.
Thanks for the hint. Yepp, we must change it, also in the search.
But if you need better security, than provided by joomla, you can use something like
function unicodeCleaner ($str=''){
return preg_replace('/[^\w\- ]/u','',$str);
}
I changed it to getString now.
And one more. Why customfields search is inside search-keyword condition?
The spaces in the search problem is close to working in subrelease J.
Now when you have spaces in the search string, the search results are correct.
However, it still takes out the space in the search bar, after you hit search and you're on the search results page.
/components/com_virtuemart/views/category/view.html.php : 102
$keyword = JRequest::getWord('keyword', '');
to
$keyword = JRequest::getString('keyword', '');
Note that JRequest::getString doesn't filter bad utf-8 symbols