Any plans to port this to Drupal 7?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

basicmagic.net’s picture

subscribe

mitch albert’s picture

subscribe

mitch albert’s picture

FileSize
12.43 KB

I created a port to drupal 7 since i needed it for a drupal7 project.

- also added the autocomplete function of google.
- Im not planning to maintain this in the future.

jweowu’s picture

If anyone runs with this, #923694: Enable autocompletion on the search form was a more robust implementation of the autocomplete functionality for the 6.x version. I would recommend porting that.

malcomio’s picture

Status: Active » Needs review
FileSize
13.66 KB

Here's a version using the alternate autocompletion approach

rooby’s picture

Is #5 definitely the one I should use?

It would probably be best to port the current version and then implement the changes in #5 in the #923694: Enable autocompletion on the search form issue for drupal 6 & 7?
Unless that patch can be committed for drupal 6 as well as this 7 version going up, so they remain in line.

It is a bit harder to test when you have to test the port and a separate new feature.

Anyway, the patch in #5 works but I'm getting these notices around the site:

Notice: Undefined variable: keys in _google_cse_adv_form_alter_search_box() (line 489 of /var/www/mysite/sites/all/modules/contrib/google_cse_adv/google_cse_adv.module).

The functionality is working though (I have not tried the autocomplete part).

I'll dig further soon.

jweowu’s picture

rooby: #5 isn't quite right, because the form alter functions from the 6.x versions weren't used in #3, so some new/inconsistent code has been introduced.

FWIW I agree that a cleaner port of the 6.x version is possibly needed here (or at the very least, someone needs to evaluate and document the differences between the two).

I'm unlikely to be looking into that myself, as I've no need for a 7.x version of this module.

rooby’s picture

I will almost certainly be cleaning up the port as I need it for a drupal 7 site.

I will post back changes here.

I also contacted the maintainer about getting a branch going for the D7 version.

rooby’s picture

Here is the version I'm currently using.

It has a bunch of cleanup and some bug fixes.

The only known issue for my current usage is that the autocomplete functionality doesn't work.

Google no longer requires an api key for this feature, so that has been removed, but there are still issues I have yet to have time to investigate.

Another thing to note is I have changed the api functions, and the corresponding API.txt.

I think that it makes the API more logical and the port to drupal 7 is a good time to change APIs.

alexmoreno’s picture

we (malcomio and myself) have a D7 version and probably will have a D8 in a short future. We have already contacted to meba regarding the maintenance of the module (we have no problem on maintaining the new branches), no reply so far.

Thank you.

rooby’s picture

I actually switched to the https://drupal.org/project/gss module as it already supports autocomplete, which was broken in this version.

Seeing as there is https://drupal.org/project/gss and also https://drupal.org/project/google_cse I think that having this module as well is a bit too much fragmentation.

3 modules that all essentially do the same thing and split developer time.

There is also an issue open for the google_cse module to support the paid XML feature of google site search.
See #348311: Allow a third display option: display on site without JavaScript/frames

Would it be possible maybe you could contribute your work to that issue and depricate this module?

kwfinken’s picture

  • While I agree that we should avoid fragmentation, gss serves a very different purpose than cse. To use gss, one needs to have a Google Site Search (PAID) account where as CSE is available to the modules that handle the two cases two would cause confusion.
  • Combining CSE and Google Custom Search Engine Advanced does seem like a good idea since the advanced module does have features which are not in the CSE module but which would not confuse basic users, so long as the defaults were set properly. The question, though is whether the code base is such that merging would be feasible in a reasonable amount of work (not having looked at the code, I can't answer the issue).
rooby’s picture

I understand that there are paid and unpaid version of google site search, but there are already 2 modules that address both cases.
This module has always only served the paid version also.

Why should we continue with the third, duplicate module?

The cse module is currently for the non-paid version, but people have indicated they would be happy for it to also server the paid version's users.

I believe the issue I linked to for cse before already has a patch to add that to the cse module, however it is old and would certainly need work.

I feel like whatever ends up being posted in this issue could be added to either one of those other modules.
It doesn't really matter which, I guess whichever would require the least work to get the desired result.

alexmoreno’s picture

I didn't know about the patch for the main module. It makes a lot of sense, I have no problem at all to contribute the current changes and/or merge them with the patch in https://drupal.org/node/348311