Skip to content

Commit b1eece2

Browse files
author
Joan He
committed
MAGETWO-91555: Admin orders can result in a customer with an example email address
1 parent e22b7a2 commit b1eece2

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected function _addAdditionalFormElementData(AbstractElement $element)
147147
{
148148
switch ($element->getId()) {
149149
case 'email':
150-
$element->setRequired(0);
150+
$element->setRequired(1);
151151
$element->setClass('validate-email admin__control-text');
152152
break;
153153
}

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,26 +2012,13 @@ protected function _validate()
20122012
}
20132013

20142014
/**
2015-
* Retrieve or generate new customer email.
2015+
* Retrieve new customer email.
20162016
*
20172017
* @return string
20182018
*/
20192019
protected function _getNewCustomerEmail()
20202020
{
2021-
$email = $this->getData('account/email');
2022-
if (empty($email)) {
2023-
$host = $this->_scopeConfig->getValue(
2024-
self::XML_PATH_DEFAULT_EMAIL_DOMAIN,
2025-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
2026-
);
2027-
$account = time();
2028-
$email = $account . '@' . $host;
2029-
$account = $this->getData('account');
2030-
$account['email'] = $email;
2031-
$this->setData('account', $account);
2032-
}
2033-
2034-
return $email;
2021+
return $this->getData('account/email');
20352022
}
20362023

20372024
/**

0 commit comments

Comments
 (0)