Moved event to correct place (#430)

This commit is contained in:
Elias Luhr
2021-09-15 09:48:43 +02:00
committed by GitHub
parent 078ee0d956
commit 6a912289f7
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@
- Fix #384: Delete flash messages after consuming (cgsmith) - Fix #384: Delete flash messages after consuming (cgsmith)
- Enh: Added SK translations (snickom) - Enh: Added SK translations (snickom)
- Fix: allow password_changed_at to be saved when reseting password (p4blojf) - Fix: allow password_changed_at to be saved when reseting password (p4blojf)
- Fix #430: Moved EVENT_BEFORE_PROFILE_UPDATE to correct place (eluhr)
## 1.5.1 April 5, 2020 ## 1.5.1 April 5, 2020
- Fix #370: Extending view fix (effsoft) - Fix #370: Extending view fix (effsoft)

View File

@ -189,8 +189,8 @@ class AdminController extends Controller
$this->make(AjaxRequestModelValidator::class, [$profile])->validate(); $this->make(AjaxRequestModelValidator::class, [$profile])->validate();
if ($profile->load(Yii::$app->request->post())) { if ($profile->load(Yii::$app->request->post())) {
$this->trigger(UserEvent::EVENT_BEFORE_PROFILE_UPDATE, $event);
if ($profile->save()) { if ($profile->save()) {
$this->trigger(UserEvent::EVENT_BEFORE_PROFILE_UPDATE, $event);
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Profile details have been updated')); Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Profile details have been updated'));
$this->trigger(UserEvent::EVENT_AFTER_PROFILE_UPDATE, $event); $this->trigger(UserEvent::EVENT_AFTER_PROFILE_UPDATE, $event);
@ -330,7 +330,7 @@ class AdminController extends Controller
return $this->redirect(['index']); return $this->redirect(['index']);
} }
/** /**
* Forces the user to change password at next login * Forces the user to change password at next login
* @param integer $id * @param integer $id