Between these two commits, around line 1136, one of the differences/additions is below:
- https://github.com/magento/magento2/blob/524cb8037aaf0cf1835077a9fdbb2f7dc706e9e4/app/code/Magento/Customer/Model/AccountManagement.php
- https://github.com/magento/magento2/blob/44265c9c69b2ab860f1c3461a097581d1f01fa40/app/code/Magento/Customer/Model/AccountManagement.php
I am failing to see how having the $guestLoginConfig check would play a part in determining if a given email address is available (aka does not belong to an existing customer already, as I understand the purpose of this function to essentially be). It has broken a custom plugin we rely on. Can anyone explain why it was added? I appreciate any insight.
public function isEmailAvailable($customerEmail, $websiteId = null)
{
// BEGIN NEWLY ADDED CODE
$guestLoginConfig = $this->scopeConfig->getValue(
self::GUEST_CHECKOUT_LOGIN_OPTION_SYS_CONFIG,
ScopeInterface::SCOPE_WEBSITE,
$websiteId
);
if (!$guestLoginConfig) {
return true;
}
// END NEWLY ADDED CODE
try {
if ($websiteId === null) {
$websiteId = $this->storeManager->getStore()->getWebsiteId();
}
$this->customerRepository->get($customerEmail, $websiteId);
return false;
} catch (NoSuchEntityException $e) {
return true;
}
}