Hi, on my site the google_cse is giving an essentially blank page. It used to work, and I haven't the foggiest idea when it stopped working. It might be recent because the site's users only recently started complaining.
You can see it at http://visforvoltage.org - just enter search terms in the search box at the top of the page.
I played around with it a bit and found that changing the URL so the query= parameter to be q= and then reran that URL, then the search results page works. That is, as noted on the project home page the correct parameter name is "q" not "query" ... Why does the URL have query= ??
Comments
Comment #1
reikiman commentedFWIW after posting this I saw #393878: Search returns nothing which reported a similar issue. In that discussion someone suggested to uninstall then reinstall the module. That did not work in that after uninstall/install it had the same behavior.
I've looked a little closer .. with the config to display results on Google, a Form is created whose action points to google.com/cse and one of whose input elements has the name 'query'. But the Google CSE wants that query attribute name to be "q" rather than "query". It looks like the place to make this change is in the function google_cse_searchbox_form_builder and to change the code to build
rather than the $form['query'] values it is currently building. It should use $form['query'] when the settings say to display results on this site, and use $form['q'] when the settings say to display results on google.
Comment #2
ramlev commentedI have fixed the issue, the problem is that Google have changed one of the query parameters from 'query' to 'q', therefore the search query isn't parsed into the search field.
Implement the patch, and everything should work.
Comment #3
technikh commentedThe patch didn't work for me. I am getting a Page not found error on clicking the search button
Comment #4
technikh commentedmarking the issue critical as The module functionality Broke completely
Comment #5
dunklea commentedI'm getting a 404 error, too. Thanks for your support. Hopefully we can solve this issue soon.
Cheers,
Andrew
Comment #6
ttkaminski commentedThe patch in #2 didn't work for me. I fixed the problem by adding:
in google_cse_results.tpl.php.
If you inspect http://www.google.com/afsonline/show_afs_search.js, you will see that it looks at that variable to determine which query string variable to use for the search key. By default it's "q", but that interferes with Drupal.
Comment #7
mealto commentedThanks, this one line works. I know there are two other patches out there but this one is only 1 line! Thanks, it worked.
Let me give proper credit and a reference to the 1 line fix - search-results-page-empty-except-for-header-1268352-6.patch: http://drupal.org/files/search-results-page-empty-except-for-header-1268...
Thanks @ttkaminski!
Only 1 issue, after this fix, there is about a 500 pixel high white / blank area at the bottom of the search results area. Anyone know how this can be fixed?
Comment #8
davidhernandez#6 worked for me. Thank you.
Comment #9
namita21 commented#6 worked me for me too, Thanks.
Comment #10
jscm commented#6 works for me.
When will arrive the new official release that fix this problem?
Comment #11
ttamniwdoog commented#6 worked for me also. I simply copied the .patch file to the same directory as the
google_cse_results.tpl.phpThen I executed
patch -b < search-results-page-empty-except-for-header-1268352-6.patchComment #12
omnia.ibrahim commentedHow can we change Ads position? it is now at the top, and the module settings not affecting its location
Comment #13
flbr commentedAny ideas on how to fix this issue for Drupal 5 version?
Comment #14
flbr commentedWhoops, sorry about changing the version.
Comment #15
flbr commentedAh, found it for Drupal 5 module:
In google_cse.module add this line:
var googleSearchQueryString = "query";on line 340, after:
So it becomes:
Comment #16
blogjam commentedThanks for this.
Comment #17
technikh commented#6 worked for me. Thank you.
Comment #18
attheshow commented#6 worked for me too. I think that's enough people who have tested the fix to mark this as RTBC.
Comment #19
brianbatesd commented#6 also confirmed working here. Thank you.
Comment #20
pianomansam commented#6 also worked for me. Please get this patch in ASAP.
Comment #21
sdeng commentedThanks flbr for #15, it works for my version 5.
Comment #22
technikh commenteddid Google change sitesearch parameter too? Site specific search is not working now?
SiteSearch domain:
"If set, users will be presented with the option of searching only on the domain(s) specified rather than using the CSE. Enter one domain or URL path followed by a description (e.g. example.com/user Search users) on each line."
Comment #23
scribbles commentedHi. Just a note of something that I discovered. A quick fix until the module gets updated for drupal 6.xx is to use the drupal adsense module which has an option for google CSE. For some reason when using the CSE within the adsense module all is working. I have several sites and the ones that offer the visitor CSE that are using the option from within the adsense module are fine. The sites offering the CSE by means of the CSE module are not working. Just thought I would post this as an easier fix for the non-techie.
Rob
Comment #24
bkelly commentedThanks flbr, #15 worked for me.
Rather than hack the module I added the theme function to template.php
Comment #25
IntoTheWoods commentedYou can't change the version until the 6.x patch has been committed - otherwise the maintainers won't see and commit it.
Comment #26
malcomio commentedTidying up the issue queue, and marking issues as won't fix where the version is no longer supported.