Hi,

I've got a custom node type for which I enabled captcha but the problem is that the captcha fieldset appears at the top of the form and not at the bottom. Plus the text field size is 60 whereas on the contact form it's a lot smaller (using Math question).

Would appreciate a reply.

Thanks

Comments

soxofaan’s picture

Does your form has some custom or hardcoded theming?

CAPTCHA just searches in a best effort way for a submit button in the form and picks a slightly lower weight, so that the drupal form theming positions the CAPTCHA stuff above the submit button.

However, when there is some custom theming involved, it is possible that the order defined by the weight is not followed.
The standard Drupal node form for example has some hardcoded theming which make it impossible very hard to place the CAPTCHA fieldset directly above the submit button.

hadpnk’s picture

No, nothing like that. I only changed the order of the fields in Edit Node Type. Looking at the weights with Devel Theme info, I've got for Taxonomy weight 0
captcha weight 0.015
field_1 weight 0 (user field moved to top in CCK)
field_2 weight 0 (user field moved to top in CCK)
title field weight6
body field weight7
button weight 5

Does that makes sense?

soxofaan’s picture

if that are your weights, then CAPTCHA should end up above the button and below taxon, field_1 and field_2.
But if I understood you correctely, CAPTCHA is also above taxon, field_1 and field_2?

hadpnk’s picture

The list is sorted by order of appearance, so first taxon then captcha then field_1, etc. That's why I'm thinking the weights don't make sense??

Any solution to this? Plus the input field is too long - what would cause that?

soxofaan’s picture

Title: Captcha shows at the top on custom node type » problems with CAPTCHA on custom CCK node form
Category: support » bug

Ok, now I understand. It wasn't clear that you were using CCK for the custom node type.
But I tried and I reproduced both problems: placement at top of form and wide input field.

this needs closer investigation on what is happening behind the curtains and what CCK is doing differently form-wise.
but at the moment and the coming month I don't have time for that.

hadpnk’s picture

Thanks for your reply. Can you suggest some sort of quick fix (custom template?? I'm a bit new to Drupal) as I'd like to go live with my site sometime next week?

mariusooms’s picture

Having identical issue when adding CCK fields. I don't mind a hard coded solution to set Captcha to -10 if needed.

Kind regards,

Marius

shyamala’s picture

Having identical situation with catcha and a custom form. Any help or patch appreciated, as we need to go live tomorrow.

soxofaan’s picture

FYI: at the moment, I'm a bit overwhelmed with my day job and can't invest time in CAPTCHA module development. So I can't research this issue, nor provide patches. This will not change until mid October.

The only workarounds for know I can think of are:
a custom hook_form_alter for repositioning the CAPTCHA form elements
or custom theming of the form so that your form has the desired layout.

mariusooms’s picture

You can also just hardcode the weight. I experimented with a bunch of values until it sat in the right place.

Regards,

Marius

soxofaan’s picture

Status: Active » Closed (duplicate)
finex’s picture

Bug #423736 is closed, but this bug (301145) has not been solved yet (on D6)

soxofaan’s picture

Version: 6.x-1.0-rc2 » 6.x-2.x-dev

As far as it tested, it is solved for CAPTCHA 6.x-2.x-dev. If there are still issues for you, please describe your node type and CCK fields.

It is unlikely that it will be solved for CAPTCHA 6.x-1.x-dev (given the fact that I am the only active maintainer ATM and I have not much resources ATM)

finex’s picture

Ok, I've used 6.x-2.x-beta2, it has been fixed after this release. I've just tried current -dev which works. Thanks.