diff --git a/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php b/src/Oro/Bundle/CustomerBundle/Layout/DataProvider/FrontendCustomerUserFormProvider.php index 32c5130f8..46c1fde5d 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'] = isset($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'] = isset($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'] = isset($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'] = isset($options['action']) ?: $this->generateUrl(static::ACCOUNT_USER_PASSWORD_RESET_ROUTE_NAME); return $this->getForm(CustomerUserPasswordResetType::class, $customerUser, $options); } @@ -125,14 +125,18 @@ private function getCustomerUserFormOptions(CustomerUser $customerUser) { $options = []; + if (isset($options['action'])) { + return $options; + } + 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 +151,14 @@ private function getCustomerUserFormOptions(CustomerUser $customerUser) private function getProfilerFormOptions(CustomerUser $customerUser) { $options = []; + + if (isset($options['action'])) { + return $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()] );