|
8 | 8 |
|
9 | 9 | namespace EzSystems\EzPlatformUser\Form\Factory; |
10 | 10 |
|
| 11 | +use eZ\Publish\API\Repository\Values\ContentType\ContentType; |
11 | 12 | use EzSystems\EzPlatformUser\Form\Data\UserPasswordForgotData; |
12 | 13 | use EzSystems\EzPlatformUser\Form\Data\UserPasswordChangeData; |
13 | 14 | use EzSystems\EzPlatformUser\Form\Data\UserSettingUpdateData; |
@@ -41,19 +42,19 @@ public function __construct(FormFactoryInterface $formFactory, UrlGeneratorInter |
41 | 42 | $this->urlGenerator = $urlGenerator; |
42 | 43 | } |
43 | 44 |
|
44 | | - /** |
45 | | - * @param \EzSystems\EzPlatformUser\Form\Data\UserPasswordChangeData|null $data |
46 | | - * @param string|null $name |
47 | | - * |
48 | | - * @return \Symfony\Component\Form\FormInterface |
49 | | - */ |
50 | 45 | public function changeUserPassword( |
| 46 | + ContentType $contentType, |
51 | 47 | UserPasswordChangeData $data = null, |
52 | 48 | ?string $name = null |
53 | 49 | ): FormInterface { |
54 | 50 | $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordChangeType::class); |
55 | 51 |
|
56 | | - return $this->formFactory->createNamed($name, UserPasswordChangeType::class, $data); |
| 52 | + return $this->formFactory->createNamed( |
| 53 | + $name, |
| 54 | + UserPasswordChangeType::class, |
| 55 | + $data, |
| 56 | + ['content_type' => $contentType] |
| 57 | + ); |
57 | 58 | } |
58 | 59 |
|
59 | 60 | /** |
@@ -100,11 +101,14 @@ public function forgotUserPasswordWithLogin( |
100 | 101 | */ |
101 | 102 | public function resetUserPassword( |
102 | 103 | UserPasswordResetData $data = null, |
103 | | - ?string $name = null |
| 104 | + ?string $name = null, |
| 105 | + ContentType $contentType = null |
104 | 106 | ): FormInterface { |
105 | 107 | $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordResetType::class); |
106 | 108 |
|
107 | | - return $this->formFactory->createNamed($name, UserPasswordResetType::class, $data, ['content_type' => $data->getContentType()]); |
| 109 | + $userContentType = $contentType ?? $data->getContentType(); |
| 110 | + |
| 111 | + return $this->formFactory->createNamed($name, UserPasswordResetType::class, $data, ['content_type' => $userContentType]); |
108 | 112 | } |
109 | 113 |
|
110 | 114 | /** |
|
0 commit comments