Rapsys Git
/
packbundle
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d23e619
)
Set bundle alias as translation domain for captcha inherited forms
author
Raphaël Gertz
<git@rapsys.eu>
Sun, 8 Dec 2024 04:50:06 +0000
(
05:50
+0100)
committer
Raphaël Gertz
<git@rapsys.eu>
Sun, 8 Dec 2024 04:50:06 +0000
(
05:50
+0100)
Form/CaptchaType.php
patch
|
blob
|
history
diff --git
a/Form/CaptchaType.php
b/Form/CaptchaType.php
index c3a5f69c4559e8d588ad40d62f5453dcc8f8c0a2..015a91bac486f8a522540c2d2c0cc6b2e5040439 100644
(file)
--- a/
Form/CaptchaType.php
+++ b/
Form/CaptchaType.php
@@
-11,6
+11,7
@@
namespace Rapsys\PackBundle\Form;
namespace Rapsys\PackBundle\Form;
+use Rapsys\PackBundle\RapsysPackBundle;
use Rapsys\PackBundle\Util\ImageUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
use Rapsys\PackBundle\Util\ImageUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
@@
-49,7
+50,7
@@
class CaptchaType extends AbstractType {
//With image, slugger and translator
if (!empty($options['captcha']) && $this->image !== null && $this->slugger !== null && $this->translator !== null) {
//Set captcha
//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]);
//Add captcha token
$builder->add('_captcha_token', HiddenType::class, ['data' => $captcha['token'], 'empty_data' => $captcha['token'], 'mapped' => false]);
@@
-70,7
+71,7
@@
class CaptchaType extends AbstractType {
parent::configureOptions($resolver);
//Set defaults
parent::configureOptions($resolver);
//Set defaults
- $resolver->setDefaults(['captcha' => false]);
+ $resolver->setDefaults(['captcha' => false
, 'translation_domain' => RapsysPackBundle::getAlias()
]);
//Add extra captcha option
$resolver->setAllowedTypes('captcha', 'boolean');
//Add extra captcha option
$resolver->setAllowedTypes('captcha', 'boolean');