Backoffice search autocomplete - Issue with extended words
Hi there,
I'm having an issue with the search autocomplete in the top left - If I search for a word & get results (e.g. "Sam") then continue that word (e.g. "Samuel"), I get no further results. In the Javascript console, I get an error like so:
Uncaught TypeError: Object 4778 has no method 'indexOf'
Object '4478' is the first result returned by the first search ("Sam"). I have tested this occurring in IE8 / FF / Chrome, and have tested there are results for the extended word ("Samuel") when searched from it's other title words, and in the search dialog (/umbraco/dialogs/search.aspx).
go to /umbraco_client/Application/JQuery/jquery.autocomplete.js
open that bad boy up and edit the line in matchSubset that looks like this:
var i = s.indexOf(sub);
so that it looks like this (essentially you're having it do a lookup on the s object to see if it can find any indexOf method, BEFORE it tries to use it. I imagine there is a bug somewhere in the cache mechanism that causes s to be passed improperly to the matchSubset function, but I don't want to waste time debugging it. This will fix it:
var i = s["indexOf"] ? s.indexOf(sub) : -1;
You may have to go to your ~/App_Data/TEMP/ClientDependency folder and delete all the files then do a hard refresh (ctrl-R / F5) in the backoffice to clear out the cached JS file before the error goes away.
Backoffice search autocomplete - Issue with extended words
Hi there,
I'm having an issue with the search autocomplete in the top left - If I search for a word & get results (e.g. "Sam") then continue that word (e.g. "Samuel"), I get no further results. In the Javascript console, I get an error like so:
Object '4478' is the first result returned by the first search ("Sam"). I have tested this occurring in IE8 / FF / Chrome, and have tested there are results for the extended word ("Samuel") when searched from it's other title words, and in the search dialog (/umbraco/dialogs/search.aspx).
I'm using v4.5.2
Any help appreciated, thanks.
Did you get any resolution to this issue? I have experiencing the same thing with Umbraco v4.7.0.
my fix was this:
go to /umbraco_client/Application/JQuery/jquery.autocomplete.js
open that bad boy up and edit the line in matchSubset that looks like this:
var i = s.indexOf(sub);
so that it looks like this (essentially you're having it do a lookup on the s object to see if it can find any indexOf method, BEFORE it tries to use it. I imagine there is a bug somewhere in the cache mechanism that causes s to be passed improperly to the matchSubset function, but I don't want to waste time debugging it. This will fix it:
var i = s["indexOf"] ? s.indexOf(sub) : -1;
You may have to go to your ~/App_Data/TEMP/ClientDependency folder and delete all the files then do a hard refresh (ctrl-R / F5) in the backoffice to clear out the cached JS file before the error goes away.
is working on a reply...