namespace Rapsys\PackBundle\Form;
+use Rapsys\PackBundle\RapsysPackBundle;
use Rapsys\PackBundle\Util\ImageUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
//With image, slugger and translator
if (!empty($options['captcha']) && $this->image !== null && $this->slugger !== null && $this->translator !== null) {
//Set captcha
- $captcha = $this->image->getCaptcha((new \DateTime('-1 year'))->getTimestamp());
+ $captcha = $this->image->getCaptcha();
//Add captcha token
$builder->add('_captcha_token', HiddenType::class, ['data' => $captcha['token'], 'empty_data' => $captcha['token'], 'mapped' => false]);
parent::configureOptions($resolver);
//Set defaults
- $resolver->setDefaults(['captcha' => false]);
+ $resolver->setDefaults(['captcha' => false, 'error_bubbling' => true, 'translation_domain' => RapsysPackBundle::getAlias()]);
//Add extra captcha option
$resolver->setAllowedTypes('captcha', 'boolean');