Extension talk:GoogleCustomWikiSearch

About this board

Linked CSEs are no longer supported.

4
Summary by X-Savitar

OT

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.

Kghbln (talkcontribs)

Special page "GoogleCustomWikiSearch" fails silently. Reported with task T274708

X-Savitar (talkcontribs)
Аргскригициониец (talkcontribs)

Also not working with 1.36.

Dachy (talkcontribs)

Same for 1.36

X-Savitar (talkcontribs)

@Аргскригициониец & @Dachy, are you using the master version of the extension or the release that matches the running install of MediaWiki core?

Per the compatibility policy, "Follows the MediaWiki version lifecycle. Master is not backward compatible.".


Let me know if that solves the problems for you! Thanks!

Dachy (talkcontribs)
X-Savitar (talkcontribs)

If you're using fit, then you must have the master branch running by default and in that case, you need the master branch of the extension too.


If you are downloading release bundles, the version of the extension should match the version of MediaWiki. Like so: REL1_35

Dachy (talkcontribs)
Dachy (talkcontribs)

I manually replaced it with 1.36 and now it seems to work, because the console prints a different caveat:


Mixed Content: The page at '....' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/cse/cse.js?theme=V2_DEFAULT&language=.....'. This request has been blocked; the content must be served over HTTPS.


I got the point, but where should I edit? I saw this line in the main php file:

document.location.protocol == 'https' ? 'https:' : 'http:'

but my site is indeed at HTTPS now. I edited both options as HTTPS and uploaded it, still not working, like a cache somewhere still keeps the HTTP.

X-Savitar (talkcontribs)

Did you try a hard refresh after performing the edit? JS/CSS assets are cached by the browser, so a hard refresh should clear the cache.

This post was hidden by Dachy (history)
Reply to "Not working with 1.35?"
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.)

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.

Failed opening required ...GoogleCustomWikiSearch.Settings.php

4
Summary by X-Savitar

resolved on master

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.

Summary by X-Savitar

it worked!

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.

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"
There are no older topics
Return to "GoogleCustomWikiSearch" page.