From 998c751843e2f0fff396b92a1be36b34ee286978 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Mon, 13 Jan 2020 14:48:53 +0100 Subject: [PATCH] Port PHRAS-2877 Port of PHRAS-2877 User manipulator did not allow to set a null email Temporary Null email is used by saml plugin while creating a user. --- lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php b/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php index 8104c04c47..3d0815370e 100644 --- a/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php +++ b/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php @@ -368,7 +368,7 @@ class UserManipulator implements ManipulatorInterface throw new InvalidArgumentException(sprintf('Email %s is not legal.', $email)); } - if (null !== $this->repository->findByEmail($email)) { + if (($email !== null) && (null !== $this->repository->findByEmail($email))) { throw new RuntimeException(sprintf('User with email %s already exists.', $email)); }