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.
Hi,
Whatever I try, the CAPTCHA does not display on user_register_form. I have no problem on the site wide contact form, I also tried the login form and there is no problem, but on the user registration form, nothing... Any idea ?
Thank you for your work on the CAPTCHA module...
Comment | File | Size | Author |
---|---|---|---|
#20 | Capture.JPG | 31.48 KB | jdias |
#16 | 1106174-better-placement-with-actions.patch | 3.76 KB | soxofaan |
#13 | Capture.PNG | 30 KB | andrechun |
#13 | Capture2.PNG | 34.62 KB | andrechun |
#11 | captchaplacement.png | 148.12 KB | soxofaan |
Comments
Comment #1
guillaumev CreditAttribution: guillaumev commentedI tried on a clean installation and it works. It's probably due to the interaction with some module... I'll keep looking...
Comment #2
guillaumev CreditAttribution: guillaumev commentedI had a node reference in my user profile and it seems that's what was causing the problem. The captcha appeared after removing the node reference from the user profile...
Comment #3
mahfuzur CreditAttribution: mahfuzur commentedDosen't matter how many times I tried to submit captcha, it failed on user registration form. It reports " captcha didn't match"
I tried with math version. It didn't work at all.
My image version of captcha is not showing any picture.
I added few fields in user registration form. like- date of birth using date module, phone, using cck phone field, address using address field module.
Comment #4
Alexander Matveev CreditAttribution: Alexander Matveev commentedHave the same, subscribing
Comment #5
chrisolof CreditAttribution: chrisolof commentedIt appears that on the registration form captcha isn't sure exactly where to put the CAPTCHA challenge, and decides to put it right before the first button it finds on the form. This doesn't work well with a registration form that contains buttons in addition to the "Create new account" button, and causes captcha to attach its form element to whatever precedes the first button, even though this isn't the submit button.
One example of this: create a node reference field that allows users to reference unlimited nodes. It will create a button "Add another item," and captcha will attach itself to the node reference field. If you have unchecked "Display on user registration form" for this field then your node reference field, as well as the CAPTCHA challenge, will be hidden. Submitting the user registration form without filling out the required CAPTCHA challenge will of course throw a validation error - even though you were never visually presented the challenge.
I have a strong suspicion that other button-containing fields one might add to users (probably anything where unlimited values are allowed) will create the same issue for the captcha module.
The fix? Attached is a small patch against the 7.x-1.x-dev branch that tells captcha to present itself before the last button in the form (as opposed to the first button), in the case that it needs to look through buttons in a form to decide where to appear.
Comment #6
chrisolof CreditAttribution: chrisolof commentedForgot to mention: it's important that you flush the captcha placement cache (admin/config/people/captcha) after applying the patch so that captcha can redetermine where the challenge should be placed using the new code.
Comment #7
allartk CreditAttribution: allartk commentedThanks, it worked for me!
Comment #8
chrisolof CreditAttribution: chrisolof commentedAttached is an updated patch. The previous patch in comment #5 fixes the captcha placement on the registration form, but in doing so exposes another bug relating to where captcha should appear on comment forms. The attached patch fixes both bugs.
Comment #9
soxofaan CreditAttribution: soxofaan commentedtagged as "D7 stable release blocker" per #1269702: Blockers to a 7.x-1.0 release?
Comment #10
renat CreditAttribution: renat commentedPatch from #8 works fine for me, and testbot is also OK with it. So mark this as RTBC.
Comment #11
soxofaan CreditAttribution: soxofaan commentedPatch from #8 breaks placement on Node creation form: CAPTCHA is placed between preview and save button
(see attachment)
Comment #12
soxofaan CreditAttribution: soxofaan commentedHowever, in http://drupalcode.org/project/captcha.git/commit/f30c544 I already committed the part from patch #8 about the node comment forms
Comment #13
andrechun CreditAttribution: andrechun commentedseems to be working for me on both the registration page and the node creation page and the comment form
Comment #14
soxofaan CreditAttribution: soxofaan commented@andrechun: are you sure you flushed the captcha placement cache (there is a button for this on the general captcha admin page)?
Comment #15
soxofaan CreditAttribution: soxofaan commentedOk, this thread is getting cluttered with several unrelated issues, making it hard to follow.
Trying to get overiew:
So for good understanding, let's update the title, and focus on the registration placement issue. If you have unrelated issues, please start a new thread.
Comment #16
soxofaan CreditAttribution: soxofaan commentedGood news, Drupal 7 apparently added an actions form element group, with the typical buttons we want to put the CAPTCHA stuff above of. So actually we don't need to search for all buttons and take the first or last one.
Attached patch should solve the issue for the registration form, keeps things working for node creation, comment forms, etc, and probably solves related issue for other forms too.
Can you people have a look if this indeed solves your issues too?
Comment #17
soxofaan CreditAttribution: soxofaan commentedTo keep thing rolling I decided to commit the patch anyway, we are still in alpha mode:
http://drupalcode.org/project/captcha.git/commit/855288c
If you still have issues, please reopen.
Comment #18
soxofaan CreditAttribution: soxofaan commentedrelated issues (which should be solved now as well):
#1121264: Breaks Field UI's "Manage display" page.
#1304896: Captcha placement goes wrong with forms with unlimited value fields
Comment #20
jdias CreditAttribution: jdias commentedStill not working from me! The Captcha don´t appear in the Create New Account