Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So I'm using recaptcha 1.2 with Captcha 2.0-rc2 and this causes each page with recaptcha to go blank (says "read api.recaptcha.net").
So I install Captcha 1.0-rc2 and this causes each comment post with recaptcha to be "Invalid captcha token". It refuses to post.
Bear in mind, I am also using AJAX Comments module (so perhaps this has been a cause). This seems to be pretty urgent bug, I recommend quickly trying a recaptcha 1.2, captcha 2.0-rc2, and ajax comments the latest, combination and quickly patching this.
Comment | File | Size | Author |
---|---|---|---|
#36 | recaptcha.patch | 1.02 KB | bleen |
#30 | recaptcha_ajax_api_525586_30.patch | 3.25 KB | mikey_p |
#21 | admin-user-captcha.png | 44.11 KB | Francewhoa |
Comments
Comment #1
RobLoachThis seems like a pretty strange use case, and I'm not sure how it would work with reCAPTCHA since the is a straight script tag rather then a nice reCAPTHCA jQuery API. If you figure something out with it, I'd love to take a look.
Throwing it over to the CAPTCHA guys as they might know more then me.
Comment #2
soxofaan CreditAttribution: soxofaan commentedI'm not very experienced with Javascript, so the problem is also foggy for me.
I guess this is related to #487032: admin mode problem with Egglue/reCAPTCHA, which has comparable symptoms when a reCAPTCHA or egglue challenge is placed in a collapsible fieldset.
I think this is a problem of conflicting javascript between the AJAX comment script and the reCAPTCHA script, or between the Drupal fieldset collapsing javascript and the reCAPTCHA script. I think the problem is not in the CAPTCHA module itself, but on another level, however I'm ok with keeping it in this issue queue for now.
I hope someone with better javascript/jquery skills can look into this problem. Rob?
Comment #3
RobLoachLet's try throwing it over to the AJAX Comments guys and see what they say.
Comment #4
executex CreditAttribution: executex commentedMan, does anyone have any ideas? IF you do, I'll try and take a whack at the JS and see if I can fix it myself.
Anyone have AJAX comments---Recaptcha---captcha combination working properly? If so, what versions?
Comment #5
neochief CreditAttribution: neochief commentedI have 8 sites propertly working with ajax_comments + standard captcha
Comment #6
RobLoachThanks, neochief. It probably doesn't work with reCAPTCHA then because reCAPTCHA loads its resources from the external service, not expecting it to be an AJAX call. To make reCAPTCHA work with AJAX comments, I believe we'd have to add to the module to use the reCAPTCHA AJAX API.
Comment #7
executex CreditAttribution: executex commentedalright I'll give it a shot... though I don't know how I'm suppose to implement AJAX API parallel to the module? Do I just put in the JS include?
Comment #8
madlee CreditAttribution: madlee commentedI don't think this bug has anything to do with comments. I don't have comments enabled and I get the same result as the original poster. However, I only get it on the admin side of the site.
Comment #9
executex CreditAttribution: executex commentedThere's definitely a bug in recaptcha module, and recaptcha being incompatible with AJAX Comments or perhaps CAPTCHA. Though I'm pretty sure I used recaptcha perfectly when AJAX comments weren't installed.
Comment #10
madlee CreditAttribution: madlee commentedFor me, it seems that it only happens in the admin section. If I remove the ability to administer the captcha from the form, it doesn't go to the all white page.
Comment #11
wrockwood CreditAttribution: wrockwood commentedhappening for me on several sites, with jquery stuff installed, but no fancy AJAX modules at all. As far as I know, I'm not calling captcha/recaptcha via jquery.. commenting on a post does a page load, but anyone with "skip captcha" permission just gets the blank white page with "read api.recaptcha.net" in the status bar. Pretty frustrating that I can't track this issue down, so here I am. *subscribe*
Any suggestions are welcome. Thanks.
edit: adding version infos
drupal 6.13
/* $Id: recaptcha.module,v 1.13.2.4.2.11.2.6 2009/06/16 21:25:56 robloach Exp $ */
// $Id: captcha.module,v 1.96 2009/07/02 23:45:05 soxofaan Exp $
perhaps this is fixed in a later -dev? or not broken in an earlier -stable? Thanks in advance for any help or suggestions you can offer.
Comment #12
executex CreditAttribution: executex commentedYes I have EXACTLY this problem too.
If I use recaptcha and CAPTCHA... I get this "read from api.recaptcha.net" as soon as comment is submitted ( a blank WHITE page)
I would think it's a pretty easy fix, I don't know why these guys never figure it out.
Comment #13
executex CreditAttribution: executex commentedI've been looking through the code, and it doesn't seem to be an AJAX API issue. AJAX API is used to generate dynamically, the recaptcha form, quickly.
It has NOTHING to do with submitting a recaptcha form.
And like I said --- RECAPTCHA DOESN'T WORK WITH CAPTCHA NOT AJAX COMMENTS.
Try a drupal installation with captcha 2.x and recaptcha the latest, and you will see, it goes to "read api.recaptcha.net" in the status bar, and a blank WHITE page.
Comment #14
RobLoachI would absolutely love any help in fixing the issue. It may be an easy fix, but many of us have other obligations and priorities. The places where I'm using reCAPTCHA, it works very well. Without knowing more about your situation, it's hard to know exactly what's going on. If you manage to figure something out, then I'd be more then willing to commit a fix to the module, or even help out in debugging. So, post more information about where you're using it. Maybe a link? Maybe a step by step process of how you set it up? Then we might be able to help you out, otherwise we're just treading in the dark.
Thanks.
................CAPTCHA 2.x? Are you in Drupal 5 or 6? Use the stable version of CAPTCHA, not the dev version.
Comment #15
executex CreditAttribution: executex commentedAlright, I'm going to delete all my captcha, recaptcha files, uninstall, take off the modules. Then reinstall everything... and I'm going to use recaptcha 1.2 and captcha 2.0rc-1...
Hmmmmm
I rechecked my API keys too, and it seems like I was using a different key for some reason. Perhaps that might have been the problem.
Perhaps a proper error message for "Wrong API key" or something is required?
I tested now it works with both browsers ... ONLY -- WHEN YOU ARE NOT on administrator account. On anonymous, everything works fine. When you log in as admin it goes to a blank white page after it gets to recaptcha_get_html or whatever, and then says in status bar "Read api.recaptcha.net"
UPDATE: On the white blank page, this source code appears if you stop the script on the white blank page:
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha.js"></script><div id="recaptcha_widget_div" style="display:none"></div><script>Recaptcha.widget = Recaptcha.$("recaptcha_widget_div"); Recaptcha.challenge_callback();</script>
Next I'll try AJAX comments. >>>
AJAX comments enabled, now it says "Recaptcha you entered was incorrect" --- But it still posts the comment... Weird!
Comment #16
executex CreditAttribution: executex commentedBy the way , you really have to communicate with me, maybe send me your GTAlk or something, because I'm the only one reviewing the code right now.
You've already lost 2500 people who use to use recaptcha, and everyone is leaving recaptcha in mass, it simply doesn't work anymore.
Comment #17
soxofaan CreditAttribution: soxofaan commentedre #14 regarding how to reproduce:
This is a minimal Drupal form where the problem occurs: a reCAPTCHA challenge inside a collapsible fieldset
Disclaimer: I have no drupal setup around for the moment, so I didn't test the code, e.g.: I'm not sure if there also should be a submit button.
Note that there is no AJAX comments in the mix, it's only Drupal+CAPTCHA+reCAPTCHA.
(Also note that this snippet uses a new feature of CAPTCHA API 6.x-2.x to hardcode the placement and CAPTCHA type in a form)
If you set '#collapsible' to FALSE, everything should work,
but if you set '#collapsible' to TRUE, you get a white page of death with "read api.recapcha.net"
Comment #18
RobLoachI just made a rather large commit that switches from using
#input
and#process
in the form to$captcha['captcha_validate']
. It might help as it works closely to what the CAPTCHA API expects, but I'm not squre it will solve this whitescreen problem we're running into. I've testing it a bunch of times locally, and it seems to be working.Comment #19
matt_moran CreditAttribution: matt_moran commentedI just struggled with this issue for several hours. I tried both the production and the dev versions of reCAPTCHA. Same result.
My workaround is to uncheck "Add CAPTCHA administration links to forms" under admin/user/captcha.
Unfortunately I need to re-enable it whenever I want to add a CAPTCHA to a new form, but once the CAPTCHA is added and I have the right "form_id" I can disable it again.
It's not perfect, but it works.
Comment #20
cfischer50 CreditAttribution: cfischer50 commentedJust updated modules, including RECAPTCHA ... still the read api.recaptcha.net and white page.
My current solution is to set all of the forms in the Administer->User Administration -> CAPTCHA global settings to default challenge type and leave admin links in forms. Then when I set up a new form, I go into the CAPTCHA global settings and switch the challenge type to Math. Then switch it back to RECAPTCHA when the form is completed. AARGHF! But it works.
I run a second browser application so I can check not-logged-in because, of course, as admin I cannot look at the form again.
Comment #21
FrancewhoaConfirming this issue.
#19 temporary fix works for me. Thanks matt_moran. So it seems that the
Add CAPTCHA administration links to forms
option is related to this issue. Because when it's deactivated everything is working fine. Find attached screenshot to clarify.My setup:
-Drupal 6.14
-CAPTCHA 6.x-2.0-rc3
-reCAPTCHA 6.x-1.2
-I do NOT use AJAX Comments module
-Firefox 3, Galeon 2
-End user OS: Ubuntu Desktop 8.04 LTS
-Server OS: Ubuntu Server 8.04 LTS
Comment #22
soxofaan CreditAttribution: soxofaan commentedI'd like to clarify some things (I stated this before, but it doesn't hurt to repeat this for new readers/followers):
The problem/bug with the white page and "Read api.recaptcha.net" is not in the "CAPTCHA administration links" feature itself. The problem occurs when the reCAPTCHA challenge is placed in a collapsible fieldset.
The CAPTCHA administration links case is just the most common case where the reCAPTCHA widget ends up in a collapsible fieldset. Also note that the CAPTCHA administration links only appear for users with CAPTCHA-admin permissions, so normal non-admin users should not suffer from this issue.
Comment #23
soxofaan CreditAttribution: soxofaan commentedHi all,
FYI:
In preparation for a final CAPTCHA 6.x-2.0 release I added temporary workaround for the problem with the CAPTCHA admin preview of reCAPTCHA (and Egglue):
reCAPTCHA and Egglue are now blacklisted for the CAPTCHA admin preview and don't show up in the CAPTCHA admin links:
http://drupal.org/cvs?commit=265144
Note that this is a temporary workaround (in the CAPTCHA module) to address this issue in the reCAPTCHA module.
This workaround should be removed once the bug/problem itself is solved.
Comment #24
FrancewhoaThanks for clarifying soxofaan. And thanks for the temporary workaround.
Comment #25
executex CreditAttribution: executex commentedIt's been about 7 months, and this is STILL an issue with the whole "white page read api.recaptcha.net". I still haven't figured out a workaround, non of what you guys suggested works. My "add administration link" is ALREADY unchecked.
Drupal 6.15
CAPTCHA 2.1
reCaptcha 1.4
no ajax comments.
It must differ from theme to theme though, because other websites DO WORK properly with it. So someone needs to figure out how a theme function or theme can mess with this and cause this strange bewildering error. I been looking into it, but I can't find it.
Comment #26
executex CreditAttribution: executex commentedI think this is an important issue, I don't know if you agree but I hope you do because this happens in many websites and is the reason why recaptcha is losing popularity.
Comment #27
mikey_p CreditAttribution: mikey_p commentedI've got a quick patch for this against the 1.4 release. I'll try to reroll this against HEAD and post it in a few days.
Comment #28
ChaosD CreditAttribution: ChaosD commentedsubscribed
Comment #29
GreenReapersupscribed
Comment #30
mikey_p CreditAttribution: mikey_p commentedThis just switches that Recaptcha JS and HTML on the form to use their AJAX API for loading the widget. Nothing else is changed as even AJAX submissions in Drupal go through the Form API, so all the same validation works for both.
Comment #31
mikey_p CreditAttribution: mikey_p commentedBTW I'm using this in a comment form that's hidden by default, and then displayed in a thickbox, and submitted with ajax comments. It works well.
Comment #32
GreenReaperI've applied this but I'm still getting issues with AJAX Comments. If I hit reply on someone else's comments with Chrome (as an anonymous user), everything disappears except for the captcha.
Comment #33
mikey_p CreditAttribution: mikey_p commented@GreenReaper That sounds more like an issue with ajax_comments, not recaptcha, or this patch.
This patch should also work just fine without ajax_comments. To test, simply add a a div around the comment form with some javascript to show/hide it, hidden by default. With the non-ajax version this won't work.
Comment #34
hadsie CreditAttribution: hadsie commentedThe patch in #30 works great for me. Thanks @mikey_p
Comment #35
RobLoachNicely done....
http://drupal.org/cvs?commit=369042
Comment #36
bleen CreditAttribution: bleen commentedThe patch in #30 works well for me ... but if we are using AJAX to display the recaptcha challenge, shouldn't we turn page caching back on (if it was on)?
This patch does that...
During testing I made sure that several anon users could successfully pass the recaptcha challenge even if page caching is on ...
(patched against 6.x-dev)
Comment #37
RobLoachShould we put cache invalidation into a variable? The CAPTCHA module does it for some reason. Think it should be pushed over to the CAPTCHA module on the administration page? Hmmm.
Comment #38
bleen CreditAttribution: bleen commentedany more thoughts?
Comment #39
bleen CreditAttribution: bleen commentedbump ... would love to see the patch in #36 committed
Comment #40
RobLoachMe too! I just added you as a CVS maintainer :-) .
Comment #41
bleen CreditAttribution: bleen commentedSweet ... thanks Rob!
Committed to 6.x-1.x-dev