EWZRecaptchaBundle icon indicating copy to clipboard operation
EWZRecaptchaBundle copied to clipboard

This form should not contain extra fields.

Open pinodex opened this issue 10 years ago • 7 comments

screenshot from 2015-02-24 22 22 31

pinodex avatar Feb 24 '15 14:02 pinodex

Can you provide your FormType and/or the steps to reproduce ?

lethak avatar May 27 '15 09:05 lethak

I have it here.

pinodex avatar May 29 '15 08:05 pinodex

@pinodex this might not be related to this, try to debug your code and identify the "extra" field.. you can var_dump the $form->getErrors() to see (https://github.com/symfony/Form/blob/master/Form.php)

excelwebzone avatar Jun 03 '15 17:06 excelwebzone

How to reproduce the bug:

  • Create form type with empty name:
    public function getName()
    {
        return '';
    }
  • The form types will be added to form without array syntax. e.g username, nor user['username'].

recaptcha creates new field g-recaptcha-response that will be sended with the response and tha's the extra field that Symfony form detects.

So this bug occurs if you need to have clean names for your inputs.

pulzarraider avatar May 16 '16 12:05 pulzarraider

+1 on this issue, any update ?

raphaelvigee avatar May 27 '17 22:05 raphaelvigee

I don't believe this bundle is maintained anymore.

mikemix avatar Mar 06 '18 13:03 mikemix

Workaround: Form field name to match hardcoded injected field

$builder->add('g-recaptcha-response', EWZRecaptchaType::class, [
    'constraints' => [ new RecaptchaTrue() ],
]);

01e9 avatar Feb 26 '20 11:02 01e9