Skip to content

Commit 780feea

Browse files
authored
Merge pull request 2amigos#539 from edegaudenzi/feature/532_show_validation_errors_during_registration
2amigos#532 show validation errors during registration
2 parents 286aee8 + 2a9ec9d commit 780feea

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Enh: Keycloak auth client (e.luhr)
66
- Fix: Social Network Auth (eluhr)
7+
- Enh #532: /user/registration/register now shows form validation errors
78
- Enh: Allow/suggest new v3 releases of 2amigos 2fa dependencies: 2fa-library, qrcode-library (TonisOrmisson)
89

910
## 1.6.2 Jan 4th, 2024

src/User/Controller/RegistrationController.php

+4
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ public function actionRegister()
144144
);
145145
}
146146
Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User could not be registered.'));
147+
} else {
148+
if (Yii::$app->request->isPost && $form->getErrorSummary(false)) {
149+
Yii::$app->session->setFlash('danger', implode(', ', $form->getErrorSummary(false)));
150+
}
147151
}
148152
return $this->render('register', ['model' => $form, 'module' => $this->module]);
149153
}

0 commit comments

Comments
 (0)