]> Raphaël G. Git Repositories - airbundle/commitdiff
Enable contact captcha
authorRaphaël Gertz <git@rapsys.eu>
Tue, 2 Apr 2024 03:45:01 +0000 (05:45 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 2 Apr 2024 03:45:01 +0000 (05:45 +0200)
Controller/DefaultController.php
Form/ContactType.php

index 647baf844bb85af78275f564262555467072e5dd..14590963806e098561cc9da8ab44c9f23fb37847 100644 (file)
@@ -105,6 +105,7 @@ class DefaultController extends AbstractController {
                //And give the proper parameters
                $form = $this->factory->create('Rapsys\AirBundle\Form\ContactType', $data, [
                        'action' => $this->generateUrl('rapsysair_contact'),
+                       'captcha' => true,
                        'method' => 'POST'
                ]);
 
index 93951e968a8c42c724a90a974b2b683a70363a23..4142c996d4c0bc3dcdcf8a3d13b8c7ffba8f8a7a 100644 (file)
@@ -46,6 +46,9 @@ class ContactType extends CaptchaType {
         * {@inheritdoc}
         */
        public function configureOptions(OptionsResolver $resolver): void {
+               //Call parent configure options
+               parent::configureOptions($resolver);
+
                //Set defaults
                $resolver->setDefaults(['error_bubbling' => true]);
        }