Hi,

thanks for this module...

I have only one small bug-report. When I type the keyword in my search box and the hit the enter key on my keyboard, nothing actually happens. I then have to take my mouse and click on the "search" button, OR hit the enter button again, in order for the search to be performed.

I'd say that this is a bug-report, because this module is designed purely to optimize end-users' experience... so that everything is done fast! ...yet this small little glitch really spoils everything.

Could it be fixed in the near future? So that people just type in the keyword and hit the enter button once (as it is with the default drupal search) for the search to be performed.

thanks again

Comments

francoud’s picture

I would also love this fixed :)

dom.’s picture

Hi!

This should no more be the case, is it? I dont have this problem using the core themes on the last D5 (Minelli, Garland, ...).
Tell me if you still have this problem.

Thanks,
Miroslav

dom.’s picture

Status: Active » Closed (fixed)
dmendo11’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta1

I am using theme Aquia Prosper and it looks like it is not working on that theme. Is there a way to have this fixed?

I suggested to have "Search box (added by the theme)"

By the way, I have been looking for something like this for a while.

Thank you for bringing back.

David

dom.’s picture

Status: Closed (fixed) » Needs work

Hi!

I installed the "UberDrupal" profile with Acquia Prosper to check what you said (http://drupal.org/project/uberdrupal). Indeed, I had the same problem: autocompletion doesn't work with drupal theme search box (but it does with search block).

I had not much time to work on it today, but here is what I think to happen :
the Acquia Proper theme uses a template php file to override default theme search box. My module modifies the form before rendering using "hook_form_alter". Then, the form is rendered using template_preprocess_search_form which is NOT overrided by Acquia Prosper. Then, the default theme search box is rendered. But Acquia Prosper does not display it: it creates its own one with search-theme-form.tpl.php without checking the drupal search form, in other words, without checking if some modules overrided the search box. Therefore, it misses the portion of code added by this module:

<input type="hidden" disabled="disabled" value="http://sited6.axiomcafe.fr/search_autocomplete/autocomplete" id="edit-search-theme-form-1-autocomplete" class="autocomplete autocomplete-processed">

which is needed by misc/autocomplete.js to do its job.

I don't know how confortable with drupal you are. So my explanation is possibly not easy to understand. In other words: the problem comes from Acquia Prosper theme which creates its own search theme box, while my module autocompletes the drupal default search theme box.

So to make it working with this version, the easier way is probably to create a template_preprocess_search_theme function to add the proper code if "search_autocomplete" module is set to true and "search theme" option is activated:

 $enabled_forms = variable_get('search_autocomplete_forms', array());
if ($enabled_forms[search_theme_form) {
// add the code
...

I understand that using this, you will need to change the code of Acquia Prosper, which is probably something you don't want to do. I had not so much time today to figure out another solution for this module version 1.x
But I do know that other problems can appear using the drupal default autocompletion in the module. Another possible solution is for you to wait a few more days, the version 2.x of this module will let you select your form using a css id rather than using hook_form_alter. It should help fixing.

Regards,
Miro

dmendo11’s picture

Milo,

Thank you for your quick response. I did get the information, but I would rather wait for version 2.0 :).

Your work is greatly appreciated.

David

dom.’s picture

Hi David,

The 6.x-2.0-alpha1 version of Search Autocomplete is released. It is very close to what I want 2.0 version to be. Some functions are missing (compared to what 2.0 will be) but there is enought to be still more than what 1.x is ^^ (no regression!!)

I tested it with the "UberDrupal" profile: it works on my dev platform to add autocompletion to drupal theme box. I hope this profile is close to what your website is. No matter if it's working or not, let me know: I will either close this bug report or try to fix it better.

As soon as I have time, I will write a documentation to help explaining the "tricky" configurations.

Miro

dom.’s picture

Version: 6.x-1.0-beta1 » 6.x-2.0-alpha1
Status: Needs work » Needs review
dmendo11’s picture

Hi Miroslav,

I received this weird code:

Warning: Table 'username".search_autocomplete_forms' doesn't exist query: SELECT * FROM search_autocomplete_forms WHERE form_id="system_modules" in /././././includes/database.mysqli.inc on line 128

Is something missing from the SQL?

Guess I will still be on older version. :)

dom.’s picture

Hi!

Please, could you tell me when you receive this error: at update or at usage? On the module configuration page or on form setting page ?
Have you followed the update procedure in the README file? Have you started your update script at /update.php ??

Miro

dmendo11’s picture

Miro,

I uploaded the files to the server, then did the update and I got that error. Then the site went crazy with the bugs. So I reinstalled the previous version and it went back to normal. I even disable the older version, removed the files and reinstalled the new version. Still same problem.

Maybe be an issue on my side?

dom.’s picture

Hi!

I'm really sorry, I can't reproduce the error on my side: I uninstalled properly the module and installed it again from scratch. It works well for me. I did it on the ubertdrupal profile just installed. I suppose it is the closer to what you have: an updated drupal 6 + ubercart + acquia prosper theme.

I can't reproduce your problem, so I can't try to fix it unfortunately. Did you eventually took a screenshot of the error message?

I don't what to say more...

Miro

dmendo11’s picture

StatusFileSize
new166.47 KB

Miro,

A screen shot was sent. The issue is with the module itself, it only happens when I install it. Older version installed, but not working.

Thank you for your time.

David

dom.’s picture

Hi!

Let me understand: you have this error on update page or after update? Is everything fine after going back to 1.0 ?

I can't reproduce the "....database.mysqli.inc on line 128" but I could reproduce something similar on my update page. However, it did not lead to a white page error, just a drupal standard error. If I still go throught the update script, everything comes fine after udpate and the new version works like a charm.

If you want not to see the error anymore (so maybe it will correct your white screen error), you can add :

if (db_table_exists('search_autocomplete_forms')) {

at line 98 in search_autocomplete.module and close "}" at line 112.

Therefore, the code should looks like be

if (db_table_exists('search_autocomplete_forms')) {
  $results = db_query('SELECT * FROM {search_autocomplete_forms} WHERE form_id="%s"', $form_id);
  // Build an array of returned matches.
  $match = db_fetch_array($results);
  // if this form has to be autocompleted
  if ($match['enabled']) {
     if ($match['method'] == 1) {                                        // case of jQuery plugin autocomplete
         _activate_plugin_autocompletion(&$form, $form_id, $match);
     } 
     elseif ($match['method'] == 2) {                                    // case of Drupal core autocompletion
        _activate_core_autocompletion(&$form, $form_id, $match['fid']);
     }
  }
}

If wish I could help you.

dmendo11’s picture

Miro,

The problem appeared when uploading the files to the server. With the code you provided, the problem was gone. I did the update and all worked out.

I tested again to see if it was possible to see the module working, but unfortunately it is still not working.

I tested it with both the block and the site theme search and neither appear to be loading the words.

When saving the configuration to the specifications I want this is what I get:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 1 query: UPDATE search_autocomplete_forms SET weight = 0, parent_fid = 0, enabled = 0 WHERE fid = 0 LIMIT 1, 1 in /includes/database.mysqli.inc on line 128

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 1 query: UPDATE search_autocomplete_forms SET weight = 0, parent_fid = 0, enabled = 0 WHERE fid = 0 LIMIT 1, 1 in /includes/database.mysqli.inc on line 128

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 1 query: UPDATE search_autocomplete_forms SET weight = 0, parent_fid = 0, enabled = 0 WHERE fid = 0 LIMIT 1, 1 in /includes/database.mysqli.inc on line 128

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 1 query: UPDATE search_autocomplete_forms SET weight = 0, parent_fid = 0, enabled = 0 WHERE fid = 0 LIMIT 1, 1 in /includes/database.mysqli.inc on line 128

Warning: Cannot modify header information - headers already sent by (output started at
/includes/database.mysqli.inc:128) in
/includes/common.inc on line 345

I guess I will have to not add it to the site. Great module, but it is not working with us.

Thank you for your hard work though.

David

dom.’s picture

Hi!

I don't want to give up! I will try to make it better and give you another proposal. I hope it will work.

Miro

dom.’s picture

StatusFileSize
new29.69 KB
new36.03 KB
new28.11 KB

Hi!

After some investigation, I could partially reproduce your problem on my UberDrupal test profile, and therefore fix it.
Attached to this message, please find the modificated files + 2 screens showing it working:
1- the files are attached correctly
2- the module configuration page works successfully

You may have to reinstall properly or to run script update depending the state of your website. Let me know if its ok for you.

Miro

dmendo11’s picture

Status: Needs review » Fixed

Hi Miro,

Thank you for not giving up. So I installed this and now there are 0 problems from installation. It works and is working with the themed searching option as well. I have tried it with Internet explorer with administer previlage and it is working.

I have also tried safary and firefox without permissions, but these seem to not work. I will check on my side .

Thank you so much for your time,

David

dom.’s picture

Hi!

Thank YOU for all the time you took testing and reporting. I'm happy it finally works!

Miro

dmendo11’s picture

Miro,

So I rechecked about the Firefox and Safari and I know why those weren't working. I have BOOST install on the site, so I had to flush the pages since they were cached. Now they are fully operational on all browsers. One more thing, please remember to clear cache on browser setting and on performace cache settings on drupal. Otherwise you will spent countless hours searching for no reason.

Thank you again for your support,

David

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

matt-e-matic’s picture

Version: 6.x-2.0-alpha1 » 7.x-1.0

I'm having the same issue on the Zen template in D7. If you either click or press enter nothing happens.