Page MenuHomePhabricator

ReCaptcha appears only after refresh
Closed, InvalidPublic

Description

After opening /w/index.php?title=Special:UserLogin&type=signup ReCaptcha does not appear.

However it appears after F5 (refreshing the page) while being on this page.

Sometimes ReCaptcha appears in the left bottom edge of screen instead of its proper place.

MediaWiki 1.26.2

Event Timeline

Do you have an example page (link)?

I cannot. It was on my production server.

If it is really that important, I may open a new subdomain and replicate server config.

Do you want me to do this work?

Why you can't link to the prod server? There isn't any write action needed (such as account creation), right?

I switched to SimpleCaptcha on my production server, because I am afraid the bug in question may disturb new users to register.

I can't reproduce this problem :/

I reproduced the problem at http://test.withoutvowels.org/w/index.php?title=Special:UserLogin&type=signup

Here is my Captcha config:

wfLoadExtensions( array( 'ConfirmEdit', 'ConfirmEdit/ReCaptcha' ) );
$wgCaptchaClass = 'ReCaptcha';
$recaptcha_private_key = "XXX";
$recaptcha_public_key = "XXX";

Hmm, I can't reproduce the problem on the given page (visited the first time). I get the recaptcha on the first page load. What browser do you use?

I tried both Firefox 44.0.2 and Chromium 47.0.2526.80 running on Debian Linux "stretch".

When I open the link (with middle mouse click to open a new tab), the captcha appears. However after this I press Ctrl+L and then Enter to access the same page again and AFTER THIS I see no captcha.

When I repeat this (Ctrl+L and then Enter) I most of the time see no captcha, however sometimes the captha appears after this but near the bottom left edge of the page instead of above "Create account" button (where it should be).

Quite weird.

Florian triaged this task as Low priority.

Ok, now I see the problem (sorry,, I haven't seen, that you're using the older ReCaptcha module, not the noCaptcha). The problem is, that the google script uses document.write to add the captcha module, which is stubbed by MediaWiki (in wikibits.js). I'll try to work around this, but this will always be an ugly hack, so I suggest to use the more modern noCaptcha module.

I've changed the config for http://test.withoutvowels.org/w/index.php?title=Special:UserLogin&type=signup to use:

wfLoadExtensions( array( 'ConfirmEdit', 'ConfirmEdit/ReCaptchaNoCaptcha' ) );
$wgCaptchaClass = 'ReCaptchaNoCaptcha';
$recaptcha_private_key = "XXX";
$recaptcha_public_key = "XXX";

Now I see "To protect the wiki against automated account creation, we kindly ask you to solve the following CAPTCHA: " message, but no captcha widget. Now F5 does not help.

Please help.

Oh, I've found why NoCaptcha didn't work. Now I have accomplished setup.

I will delete test.withoutvowels.org domain, which was used for testing.

Change 272331 had a related patch set uploaded (by Florianschmidtwelzow):
ReCaptcha: Workround non-working JavaScript added with document.write

https://gerrit.wikimedia.org/r/272331

@VictorPorton Could you please test the change above (https://gerrit.wikimedia.org/r/272331) if this works for you? I hope the commit message is understandable :]

I won't test. I have switched to NoCaptcha and have already deleted my testing wiki.

Change 272331 had a related patch set uploaded (by Florianschmidtwelzow):
ReCaptcha: Workround non-working JavaScript added with document.write

https://gerrit.wikimedia.org/r/272331

Change 272331 abandoned by Florianschmidtwelzow:
ReCaptcha: Workround non-working JavaScript added with document.write

Reason:
Let's don't ride on dead horses. See also: T142133

https://gerrit.wikimedia.org/r/272331

Krinkle renamed this task from ReCaptcha appears only after F5 to ReCaptcha appears only after refresh.Nov 18 2016, 9:45 PM
Krinkle updated the task description. (Show Details)

We no longer support the reCaptcha module, therefore I close this task as invalid, sorry! :)