diff --git a/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php b/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php index 32c5130f8..1a96b5be5 100644 --- a/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php +++ b/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php @@ -51,7 +51,7 @@ public function getCustomerUserForm(CustomerUser $customerUser) */ public function getForgotPasswordFormView(array $options = []) { - $options['action'] = $this->generateUrl(self::ACCOUNT_USER_RESET_REQUEST_ROUTE_NAME); + $options['action'] = $options['action'] ?? $this->generateUrl(static::ACCOUNT_USER_RESET_REQUEST_ROUTE_NAME); return $this->getFormView(CustomerUserPasswordRequestType::class, null, $options); } @@ -63,7 +63,7 @@ public function getForgotPasswordFormView(array $options = []) */ public function getForgotPasswordForm(array $options = []) { - $options['action'] = $this->generateUrl(self::ACCOUNT_USER_RESET_REQUEST_ROUTE_NAME); + $options['action'] = $options['action'] ?? $this->generateUrl(static::ACCOUNT_USER_RESET_REQUEST_ROUTE_NAME); return $this->getForm(CustomerUserPasswordRequestType::class, null, $options); } @@ -75,7 +75,7 @@ public function getForgotPasswordForm(array $options = []) */ public function getResetPasswordFormView(CustomerUser $customerUser = null) { - $options['action'] = $this->generateUrl(self::ACCOUNT_USER_PASSWORD_RESET_ROUTE_NAME); + $options['action'] = $this->generateUrl(static::ACCOUNT_USER_PASSWORD_RESET_ROUTE_NAME); return $this->getFormView(CustomerUserPasswordResetType::class, $customerUser, $options); } @@ -87,7 +87,7 @@ public function getResetPasswordFormView(CustomerUser $customerUser = null) */ public function getResetPasswordForm(CustomerUser $customerUser = null) { - $options['action'] = $this->generateUrl(self::ACCOUNT_USER_PASSWORD_RESET_ROUTE_NAME); + $options['action'] = $this->generateUrl(static::ACCOUNT_USER_PASSWORD_RESET_ROUTE_NAME); return $this->getForm(CustomerUserPasswordResetType::class, $customerUser, $options); } @@ -127,12 +127,12 @@ private function getCustomerUserFormOptions(CustomerUser $customerUser) if ($customerUser->getId()) { $options['action'] = $this->generateUrl( - self::ACCOUNT_USER_UPDATE_ROUTE_NAME, + static::ACCOUNT_USER_UPDATE_ROUTE_NAME, ['id' => $customerUser->getId()] ); } else { $options['action'] = $this->generateUrl( - self::ACCOUNT_USER_CREATE_ROUTE_NAME + static::ACCOUNT_USER_CREATE_ROUTE_NAME ); } @@ -147,9 +147,10 @@ private function getCustomerUserFormOptions(CustomerUser $customerUser) private function getProfilerFormOptions(CustomerUser $customerUser) { $options = []; + if ($customerUser->getId()) { $options['action'] = $this->generateUrl( - self::ACCOUNT_USER_PROFILE_UPDATE_ROUTE_NAME, + static::ACCOUNT_USER_PROFILE_UPDATE_ROUTE_NAME, ['id' => $customerUser->getId()] );