cancel
Showing results for 
Search instead for 
Did you mean: 

Error searching from M$ Office Plug-in (chinese chars)

duxtinto
Champ in-the-making
Champ in-the-making
I'm using alfresco community 2.9b, and anytime i try to search any chinese word in the alfresco repository, via Office Plug-in, the system remains in 'waiting state' forever.

I found out (via network sniffing) that the system send back an error answer, but the plug-in doesn't do anything (only stay frozen).

I slightly modify the javascript code (search.js) of the plugin (using the encodeURIComponent function for encoding the chinese characters into the url), and it works (it's not a perfect solution, because it fails with " chars, because of an lucene exception, but it works with chinese and utf-8 characters):

   /* AJAX call to perform server-side search */
   runSearch: function(useTemplate, argPath)
   {
      OfficeAddin.showStatusText("Searching…", "ajax_anim.gif", false);

      /* ICC: He metido encodeURIComponent en esta linea para poder hacer busquedas en chino .*/
      var searchString = encodeURIComponent($('searchText').value);
      var maxResults = $('maxResults').value;

      var actionURL = useTemplate + argPath + "&search=" + searchString + "&maxresults=" + maxResults;
      var myAjax = new Ajax(actionURL, {
         method: 'get',
         headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
         evalScripts: true,
         onComplete: function(textResponse, xmlResponse)
         {
            OfficeAddin.hideStatusText();
            $('searchResultsList').innerHTML = textResponse;
         }
      });
      myAjax.request();
   }

I'm not quite related with open source development.
who should I talk to communicate this and other bugs I could fix?

Regards.
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
Hi

Thanks for spotting this issue - I'll add the fix you supplied, plus an additional one to support double quotes. Expect it to appear in the nightly builds sometime later this week.

Thanks,
Mike

duxtinto
Champ in-the-making
Champ in-the-making
Hi Mike,

That's great!

Searching using double quotes from office plugin is really useful for us too.

Regards,

David.