diff --git a/src/Eccube/Entity/Member.php b/src/Eccube/Entity/Member.php index ba2bc1edd82..18127b3ebe9 100644 --- a/src/Eccube/Entity/Member.php +++ b/src/Eccube/Entity/Member.php @@ -287,7 +287,7 @@ public function getPlainPassword(): ?string * * @return $this */ - public function setPlainPassword(string $password): self + public function setPlainPassword(?string $password): self { $this->plainPassword = $password; diff --git a/tests/Eccube/Tests/Web/Admin/Setting/System/MemberControllerTest.php b/tests/Eccube/Tests/Web/Admin/Setting/System/MemberControllerTest.php index a2f34fa6eed..d3a6bdd8181 100644 --- a/tests/Eccube/Tests/Web/Admin/Setting/System/MemberControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/Setting/System/MemberControllerTest.php @@ -222,6 +222,32 @@ public function testMemberEditSubmitFail() $this->assertTrue($this->client->getResponse()->isSuccessful()); } + /** + * @see https://github.com/EC-CUBE/ec-cube/issues/5420 + */ + public function testMemberEditSubmitFailWithPlainPasswordIsEmpty() + { + // before + $formData = $this->createFormData(); + $formData['plain_password'] = [ + 'first' => '', + 'second' => '' + ]; + $Member = $this->createMember(); + $Member->setPassword('**********'); + $this->entityManager->persist($Member); + $this->entityManager->flush(); + $mid = $Member->getId(); + + // main + $this->client->request('POST', + $this->generateUrl('admin_setting_system_member_edit', ['id' => $mid]), + ['admin_member' => $formData] + ); + + $this->assertTrue($this->client->getResponse()->isSuccessful()); + } + public function testMemberUpNotFoundMember() { // before