I'm creating a imdb web style and this module would be perfect for my site search. I installed the module and I followed the instructions, but I can not make it work. When I click the mouse on the imput of the search, the message that "they have found no word" appears to me directly (below the imput search), without having added any word. Let the js seems to work, but something does not finish work at all.

Could you help me (please)?

Comments

dcine created an issue. See original summary.

marty2081’s picture

What happens when you do type in a letter in the search box? Do you get results then? Can you post (screenshots of) your fac configuration?

ckng’s picture

Having the same issue using Basic title search service, all default config with 3 different input added.

For all 3 cases, json files are generated, autocomplete requests are sent and received correctly. In the html, could see the announce class element is updated with 10 results, but the result-list element is empty.

ckng’s picture

Looks like the last commit http://cgit.drupalcode.org/fac/commit/?h=7.x-1.x&id=64126ef52b0b1f62ceee...
is the culprit.

Restoring this code works

item.prependTo(resultList);
dcine’s picture

StatusFileSize
new24.47 KB

I tried the solution of "ckng" and nothing, it seems that I can not get it to work. When I click the mouse on the imput of the search, the message that "they have found no word" appears , and if i add a word, nothing happens.

Attached a picture of the message (in Spanish)
Can you help me (Please!)?

marty2081’s picture

@ckng: that last commit where prependTo was replaced by insertBefore only works if a "see all link" is present. That is a bug. Did you disable the see all link in the settings by chance? If so, can you try enabling it and see if the suggestions do show up?

@dcine: same question to you.

marty2081’s picture

StatusFileSize
new733 bytes

I think I fixed the bug. Can you try the following patch?

marty2081’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: fac-no_suggestions_fix-2694757-7.patch, failed testing.

dcine’s picture

Thanks again for your help! But, i added the patch and, again, nothing happens. Only the message appears.
A clarification (if could serve): as backend I'm using a search engine created with "Search API" (I tried with the drupal search engine and was the same).
And yes, i have the " Show a "view all results" link" option enabled.

Can you help me (Please!)?

marty2081’s picture

@dcine: if you look at the JavaScript console do you see any JS errors? Can you see if the fac JSON files are requested using AJAX? Can you see what the response is? Are there any results in the response?

dcine’s picture

Ok, thanks, i looked at the JavaScript console and yes, i had this error:
GET http://www.misite.com/sites/default/files/fac-json/es/r.json?nocache=1459525393742

I'm using the "Boost" and "Authcache" modules to caching drupal.

Other thing: when i run the cron (elisyacron) this message appears:

    Notice: Undefined index: items en fac_generate_json_for_key() (línea 305 de /usr/home/em8SouHuQnnG/mysite.com/sites/all/modules/fac/fac.module).
    Warning: Invalid argument supplied for foreach() en fac_generate_json_for_key() (línea 305 de /usr/home/em8SouHuQnnG/mysite.com/sites/all/modules/fac/fac.module).

And the cron is interrupted.

Could be this the problem?

Could you help me?

marty2081’s picture

@dcine: The JavaScript console line is just a message that an AJAX call was performed. That is not an error.

Can you try disabling boost and authcache to see if those modules cause an issue? I know that for instance the "stage_file_proxy" module in combination with the fac module is an issue.

The log notice is due to the fact that I never really got my head around a good system for pre-generating the json files. I changed the structure of the json generation a bit and did not change the cron job. So that is a separate bug. Can you disable generation on cron, remove all json files and see if that helps anything?

dcine’s picture

I disabled boost, Authcache and all the modules of caching and, again, nothing happens. Them i disabled "Elysia cron" module, and i deleted the json files, and the same. Is really strange.
One thing, the reported error i can see in js console, has a 404 error:

GET http://www.misite.com/sites/default/files/fac-json/es/rambo.json?nocache=1459828999721
404 Not Found

Any idea (please)?

Could you help me?

marty2081’s picture

I installed the fac module on a vanilla D7 installation and the module works as expected. I think one of your modules or your theme conflicts with the fac module.

dcine’s picture

Ok, thanks i think i found the solution:
My site is a new version of other old site. Is in a subdirectory now. I put the patch added in the last issue (https://www.drupal.org/node/2699917), and them i search in my htaccess archive and i founded this code of "boost module":

  # GZIP
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=1]
  RewriteCond %{DOCUMENT_ROOT}/mysubdirectory/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
  RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html,E=no-gzip:1]

I deleted this code and…the module works!

What I do not get is to stop the message appears "they have found no word ..." when i put the mouse imput on the imput of the search field

Could you help me (please!)?

marty2081’s picture

OK, so the patch in #2699917 works? Now the other issue: Is the "they have found no word..." text something that you configured? There is an option in the fac module to show something when the user has not entered any search terms yet. Did you set this text in that option maybe? You can just leave that option empty if you do not want to show anything when there is no search term and the input gets focus. The option is intended to be able to show the top 5 suggestions for instance.

marty2081’s picture

Status: Needs work » Closed (fixed)

No response for a month now. I consider this one closed.