Skip to content

Commit

Permalink
fix: Fix form naming
Browse files Browse the repository at this point in the history
  • Loading branch information
famoser committed Dec 1, 2024
1 parent 47d5c10 commit a566806
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Controller/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function indexAction(Request $request, TranslatorInterface $translator)
//change password form
$form = $this->handleForm(
$this->createForm(ChangePasswordType::class, $user)
->add('form.change_password', SubmitType::class, ['translation_domain' => 'account', 'label' => 'index.change_password']),
->add('submit', SubmitType::class, ['translation_domain' => 'account', 'label' => 'index.change_password']),
$request,
function ($form) use ($user, $translator) {
if (
Expand All @@ -66,7 +66,7 @@ function ($form) use ($user, $translator) {
//edit account form
$form = $this->handleForm(
$this->createForm(EditAccountType::class, $user)
->add('form.save', SubmitType::class, ['translation_domain' => 'common_form', 'label' => 'submit.update']),
->add('submit', SubmitType::class, ['translation_domain' => 'common_form', 'label' => 'submit.update']),
$request,
function ($form) use ($user, $translator) {
$this->displaySuccess($translator->trans('successful.update', [], 'common_form'));
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function indexAction(Request $request, TranslatorInterface $translator, E
//reuse create form logic
$createForm = function ($contactRequest) {
return $this->createForm(ContactRequestType::class, $contactRequest)
->add('form.send', SubmitType::class, ['translation_domain' => 'contact', 'label' => 'index.send_mail']);
->add('submit', SubmitType::class, ['translation_domain' => 'contact', 'label' => 'index.send_mail']);
};

//contact form
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/InviteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function doctorAction(Request $request, $guid, TranslatorInterface $trans
//present set password form
$form = $this->handleForm(
$this->createForm(ChangePasswordType::class, $user, ['data_class' => Doctor::class])
->add('form.set_password', SubmitType::class, ['translation_domain' => 'login', 'label' => 'reset.set_password']),
->add('set_password', SubmitType::class, ['translation_domain' => 'login', 'label' => 'reset.set_password']),
$request,
function ($form) use ($user, $translator, $request) {
//check for valid password
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function recoverAction(Request $request, EmailServiceInterface $emailServ
{
$form = $this->handleForm(
$this->createForm(RecoverType::class)
->add('form.recover', SubmitType::class, ['translation_domain' => 'login', 'label' => 'recover.title']),
->add('submit', SubmitType::class, ['translation_domain' => 'login', 'label' => 'recover.title']),
$request,
function ($form) use ($emailService, $translator, $logger) {
/* @var FormInterface $form */
Expand Down Expand Up @@ -197,7 +197,7 @@ public function resetAction(Request $request, $resetHash, TranslatorInterface $t

$form = $this->handleForm(
$this->createForm(ChangePasswordType::class, $user, ['data_class' => Doctor::class])
->add('form.set_password', SubmitType::class, ['translation_domain' => 'login', 'label' => 'reset.set_password']),
->add('submit', SubmitType::class, ['translation_domain' => 'login', 'label' => 'reset.set_password']),
$request,
function ($form) use ($user, $translator, $request) {
//check for valid password
Expand Down Expand Up @@ -240,7 +240,7 @@ public function requestAction(Request $request, InviteEmailService $emailService
{
$form = $this->handleForm(
$this->createForm(RequestInviteType::class)
->add('form.request_invite', SubmitType::class, ['translation_domain' => 'login', 'label' => 'request.request_invite']),
->add('submit', SubmitType::class, ['translation_domain' => 'login', 'label' => 'request.request_invite']),
$request,
function ($form) use ($emailService, $translator) {
/* @var FormInterface $form */
Expand Down

0 comments on commit a566806

Please sign in to comment.