diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 880f9ee3..576292c1 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -76,7 +76,7 @@ jobs: run: vendor/bin/phpstan analyse - name: Archive failed tests artifacts - test output & log - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: test-outputs-php-${{ matrix.php-versions }} diff --git a/src/User/Controller/RecoveryController.php b/src/User/Controller/RecoveryController.php index 9e675c19..9602f95c 100644 --- a/src/User/Controller/RecoveryController.php +++ b/src/User/Controller/RecoveryController.php @@ -89,14 +89,18 @@ public function actionRequest() throw new NotFoundHttpException(); } + $request = Yii::$app->request; + /** @var RecoveryForm $form */ $form = $this->make(RecoveryForm::class, [], ['scenario' => RecoveryForm::SCENARIO_REQUEST]); - + if(!$request->getIsPost() && !empty($request->get('email'))) { + $form->email = $request->get('email'); + } $event = $this->make(FormEvent::class, [$form]); $this->make(AjaxRequestModelValidator::class, [$form])->validate(); - if ($form->load(Yii::$app->request->post()) && $form->validate()) { + if ($form->load($request->post()) && $form->validate()) { $this->trigger(FormEvent::EVENT_BEFORE_REQUEST, $event); $mailService = MailFactory::makeRecoveryMailerService($form->email); diff --git a/src/User/Module.php b/src/User/Module.php index 5cd8d639..a6c68cde 100755 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -220,6 +220,7 @@ class Module extends BaseModule '' => 'registration/', 'confirm//' => 'registration/confirm', 'forgot' => 'recovery/request', + 'forgot/' => 'recovery/request', 'recover//' => 'recovery/reset' ]; /**