Extension talk:GoogleCustomWikiSearch

Jump to navigation Jump to search

About this board

Rudloff (talkcontribs)

Hello,

It seems the extension does not work anymore (it just suddenly stopped working on one of my wikis).

I get this error in the browser console:

too much recursion[En savoir plus] www.archi-wiki.org:143:1
	gcseCallback https://www.archi-wiki.org/:143:1
	ak https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:431:850
	<anonyme> https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:437:268
	gcseCallback https://www.archi-wiki.org/:144:10
	ak https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:431:850
	<anonyme> https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:437:268
	gcseCallback https://www.archi-wiki.org/:144:10
	ak https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:431:850
	<anonyme> https://www.google.com/cse/static/element/ef505fd519591213/cse_element__fr.js:437:268
...

It seems gcseCallback is calling itself too many times.

This workaround seems to make it work again:

diff --git a/GoogleCustomWikiSearch.class.php b/GoogleCustomWikiSearch.class.php
index a519217..3fe0b06 100644
--- a/GoogleCustomWikiSearch.class.php
+++ b/GoogleCustomWikiSearch.class.php
@@ -166,8 +166,6 @@ END;
                $term = $this->getTermEncoded();
                return <<<END
 function gcseCallback() {
-       if (document.readyState != 'complete')
-               return google.setOnLoadCallback(gcseCallback, true);
        google.search.cse.element.render({gname:'gcws', div:'cse', {$this->getSearchDisplayOption()}});
        var element = google.search.cse.element.getElement('gcws');
        element.execute( {$term} );

(I am not sure this is the best way to fix it though.)

Reply to "JS error"

Linked CSEs are no longer supported.

4
DikkieDick (talkcontribs)

Linked CSEs are no longer supported. See https://goo.gl/Gs1KIc.

Just installed this extension to receive the following as a result. Seems that since May 10th, 2017 it's not working anymore.

Anyone knows how to solve this?

Kkm5848 (talkcontribs)

I am also looking for help on this.

98.22.105.35 (talkcontribs)

Please do not help a stalker I have found many links I been stalked by this person for 4 years please do not help them stalk me I just sent letter to our Secretary of State for help on this issue

DikkieDick (talkcontribs)

Who are you referring to? Convenient to hide behind an ip-address and stay anonymous.

Reply to "Linked CSEs are no longer supported."
Wess (talkcontribs)

The extension will not load over wikis with https. to fix this you can delete or comment out the protocal part in line 184 at GoogleCustomWikiSearch.class.php:

/*(document.location.protocol == 'https' ? 'https:' : 'http:') +*/

and start the next line with https:

'https://www.google.com/cse/cse.js?theme...
Rudloff (talkcontribs)

I also had to edit the getScriptFileName() function in order to make it work with HTTPS:

public function getScriptFileName() {     return 'https://www.google.com/jsapi'; }

Reply to "Https problem fix"
92.195.94.14 (talkcontribs)

Hello,

MediaWiki 1.26.2
PHP 5.4.45-nmm1 (apache2handler)
MySQL 5.5.46-nmm1-log
ICU 4.8.1.1
GoogleCustomWikiSearch 0.5.0 beta

i get the warning's:

Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.googleCustomWikiSearch ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /www/....includes/OutputPage.php at line 623] in /www/.../debug/MWDebug.php on line 300

Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.googleCustomWikiSearch ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /www/...includes/OutputPage.php at line 623] in /www/....../debug/MWDebug.php on line 300

What should I Change?

thanks for helps

Patric

Reply to "Warning getModuleStyles"
Jonoribol (talkcontribs)

I get "No Results" when using this extension. I'm using MediaWiki 1.24.2 and I've tried the 2014-12-02 build of GoogleCustomWikiSearch (from here) and the latest build (today, 2015-05-15, from here). I've toggled every setting I can find, making sure to check the settings file for both versions for the proper global names. Further, I have tried I see similar extensions have similar problems, but this one can't be fixed by the same things, e.g. removing all white space from Google's code. What am I missing?

Tosfos (talkcontribs)

You should definitely use the latest version from the master/development branch. If you have a live example and can post your LocalSettings (but change the API key), I'll have a look.

Reply to "No Results"
Edmundopg (talkcontribs)

I have set all configurations: ID searcher, replace with mediawiki searcher, but doesn't do anything when I search something

www.tolkiendili.com

Tosfos (talkcontribs)

The globals on the extension's page document the latest version of the extension. Please either upgrade to the development version of the extension (recommended) or find the global names for your version in your settings file.

Edmundopg (talkcontribs)

Thanks, is it working now =)

I prefer this, to organic searcher that show all wikimedia results.

Reply to "Doesn't do anything"

Failed opening required ...GoogleCustomWikiSearch.Settings.php

4
Hutchy68 (talkcontribs)

There is an error in the GoogleCustomWikiSearch.php file

You have " require_once $dir . 'GoogleCustomWikiSearch.Settings.php'; " but the file name in the package is actually, GoogleCustomWikiSearch.settings.php. You'll need to adjust one or the other or it will throw a fatal error.

Tosfos (talkcontribs)

Good point. Truth is that on my system, this works fine. I think it's a PHP 5 feature. But it should be fixed, as well as some other minor issues in that file.

Hutchy68 (talkcontribs)

Nope, if you developed the extension on a Windows system with PHP, Windows is case insensitive. Linux file systems are case sensitive and the file name is called exactly as it is written.

Reply to "Failed opening required ...GoogleCustomWikiSearch.Settings.php"

require_once(__DIR__/GoogleCustomWikiSearch.Settings.php) [function.require-once]: failed to open stream

4
Gabuzo (talkcontribs)

In GoogleCustomWikiSearch.php, line 16, Please replace

$dir = __DIR__ . '/';

with

$dir = dirname(__FILE__) . '/';

otherwise I get:

Warning: require_once(__DIR__/GoogleCustomWikiSearch.Settings.php) [function.require-once]: failed to open stream: No such file or directory in /xxx/extensions/GoogleCustomWikiSearch/GoogleCustomWikiSearch.php on line 25

Fatal error: require_once() [function.require]: Failed opening required '__DIR__/GoogleCustomWikiSearch.Settings.php' (include_path='/xxx:/xxx/includes:/xxx/languages:.:/:/usr/local/php/pear5') in /xxx/extensions/GoogleCustomWikiSearch/GoogleCustomWikiSearch.php on line 25

Tosfos (talkcontribs)

Thanks for the feedback. That error is generated when using PHP < 5.3, which is required anyway to run the current version of MediaWiki (1.20). Those using an earlier version of MediaWiki and an older version of PHP should use your patch. I hope to add a branch for that in the near future.

89.97.245.226 (talkcontribs)

I have this error.. too

PHP message: PHP Fatal error: require_once(): Failed opening required '/var/www/html/sites/nethesis-wiki/extensions/GoogleCustomWikiSearch/GoogleCustomWikiSearch.Settings.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/sites/nethesis-wiki/extensions/GoogleCustomWikiSearch/GoogleCustomWikiSearch.php on line 26" while reading response header from upstream, client: 89.97.245.226, server: docs.nethesis.it, request: "GET /Nethesis HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "docs.nethesis.it"

Tosfos (talkcontribs)

The near future has arrived. A fix for older versions of PHP was entered for branch REL1_19. It can be downloaded from git or from this link.

Reply to "require_once(__DIR__/GoogleCustomWikiSearch.Settings.php) [function.require-once]: failed to open stream"
There are no older topics