Details
-
Bug
-
Resolution: Fixed
-
High
-
2.1.0
-
None
-
None
Description
Steps to reproduce:
- Use UserService::loadByEmail method with non-registered e-mail address, e.g. test@ez.no.
- Create the new user using PHP API with e-mail address mentioned in step 1.
- Use UserService::loadByEmail method with that e-mail address.
Result:
UserService::loadByEmail returns empty array from cache.
Expected result:
UserService::loadByEmail returns valid User instance.
More information:
When UserService::loadByEmail is called for the very first time with the non-registered email address the cache entry with empty array (returned from: https://github.com/ezsystems/ezpublish-kernel/blob/7.1/eZ/Publish/Core/Persistence/Legacy/User/Handler.php#L145) will be saved (https://github.com/ezsystems/ezpublish-kernel/blob/7.1/eZ/Publish/Core/Persistence/Cache/UserHandler.php#L92) and won't be invalidated after creation the user account with that e-mail address.