Skip to content

Commit 5b0e6d1

Browse files
committed
MAGETWO-70660: Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-70660-PR-10208
2 parents 0c46277 + af11309 commit 5b0e6d1

File tree

41 files changed

+614
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+614
-228
lines changed

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
Session $customerSession,
7373
GroupManagementInterface $groupManagement
7474
) {
75-
$quantity = $quantity ?: 1;
75+
$quantity = floatval($quantity) ? $quantity : 1;
7676
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
7777
$this->customerSession = $customerSession;
7878
$this->groupManagement = $groupManagement;

app/code/Magento/Directory/Model/Observer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ public function scheduledUpdateCurrencyRates($schedule)
126126
}
127127
}
128128

129+
$errorRecipient = $this->_scopeConfig->getValue(
130+
self::XML_PATH_ERROR_RECIPIENT,
131+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
132+
);
129133
if (sizeof($importWarnings) == 0) {
130134
$this->_currencyFactory->create()->saveRates($rates);
131-
} else {
135+
} elseif ($errorRecipient) {
136+
//if $errorRecipient is not set, there is no sense send email to nobody
132137
$this->inlineTranslation->suspend();
133138

134139
$this->_transportBuilder->setTemplateIdentifier(
@@ -148,12 +153,7 @@ public function scheduledUpdateCurrencyRates($schedule)
148153
self::XML_PATH_ERROR_IDENTITY,
149154
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
150155
)
151-
)->addTo(
152-
$this->_scopeConfig->getValue(
153-
self::XML_PATH_ERROR_RECIPIENT,
154-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
155-
)
156-
);
156+
)->addTo($errorRecipient);
157157
$transport = $this->_transportBuilder->getTransport();
158158
$transport->sendMessage();
159159

app/code/Magento/Eav/Model/Entity/Attribute.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im
2121
\Magento\Framework\DataObject\IdentityInterface
2222
{
2323
/**
24-
* Attribute code max length
24+
* Attribute code max length.
25+
*
26+
* The value is defined as 60 because in the flat mode attribute code will be transformed into column name.
27+
* MySQL allows only 64 symbols in column name.
2528
*/
26-
const ATTRIBUTE_CODE_MAX_LENGTH = 255;
29+
const ATTRIBUTE_CODE_MAX_LENGTH = 60;
2730

2831
/**
2932
* Cache tag

app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ protected function prepareMessage()
4848
$template = $this->getTemplate()->setData($this->templateData);
4949
$this->setTemplateFilter($template);
5050

51-
$this->message->setMessageType(
52-
\Magento\Framework\Mail\MessageInterface::TYPE_HTML
53-
)->setBody(
51+
$this->message->setBodyHtml(
5452
$template->getProcessedTemplate($this->templateVars)
5553
)->setSubject(
5654
$template->getSubject()

app/code/Magento/Newsletter/Model/Template.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ class Template extends \Magento\Email\Model\AbstractTemplate
4040
{
4141
/**
4242
* Mail object
43+
*
44+
* @deprecated Unused property
4345
*
44-
* @var \Zend_Mail
4546
*/
4647
protected $_mail;
4748

app/code/Magento/Newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,12 @@ public function setUp()
7474

7575
/**
7676
* @param int $templateType
77-
* @param string $messageType
7877
* @param string $bodyText
7978
* @return void
8079
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
8180
*/
8281
public function testGetTransport(
8382
$templateType = TemplateTypesInterface::TYPE_HTML,
84-
$messageType = MessageInterface::TYPE_HTML,
8583
$bodyText = '<h1>Html message</h1>'
8684
) {
8785
$filter = $this->getMock(\Magento\Email\Model\Template\Filter::class, [], [], '', false);
@@ -137,16 +135,7 @@ public function testGetTransport(
137135
$this->messageMock->expects(
138136
$this->once()
139137
)->method(
140-
'setMessageType'
141-
)->with(
142-
$this->equalTo($messageType)
143-
)->will(
144-
$this->returnSelf()
145-
);
146-
$this->messageMock->expects(
147-
$this->once()
148-
)->method(
149-
'setBody'
138+
'setBodyHtml'
150139
)->with(
151140
$this->equalTo($bodyText)
152141
)->will(

app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77

88
use Magento\Sales\Model\Order\Email\Sender;
99
use Magento\Sales\Model\Order\Creditmemo\SenderInterface;
10+
use Magento\Framework\DataObject;
1011

1112
/**
1213
* Email notification sender for Creditmemo.
14+
*
15+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1316
*/
1417
class EmailSender extends Sender implements SenderInterface
1518
{
@@ -106,13 +109,17 @@ public function send(
106109
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
107110
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
108111
];
112+
$transportObject = new DataObject($transport);
109113

114+
/**
115+
* Event argument `transport` is @deprecated. Use `transportObject` instead.
116+
*/
110117
$this->eventManager->dispatch(
111118
'email_creditmemo_set_template_vars_before',
112-
['sender' => $this, 'transport' => $transport]
119+
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
113120
);
114121

115-
$this->templateContainer->setTemplateVars($transport);
122+
$this->templateContainer->setTemplateVars($transportObject->getData());
116123

117124
if ($this->checkAndSend($order)) {
118125
$creditmemo->setEmailSent(true);

app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Sales\Model\Order\Email\NotifySender;
1313
use Magento\Sales\Model\Order\Address\Renderer;
1414
use Magento\Framework\Event\ManagerInterface;
15+
use Magento\Framework\DataObject;
1516

1617
/**
1718
* Class CreditmemoCommentSender
@@ -71,13 +72,17 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
7172
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
7273
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
7374
];
75+
$transportObject = new DataObject($transport);
7476

77+
/**
78+
* Event argument `transport` is @deprecated. Use `transportObject` instead.
79+
*/
7580
$this->eventManager->dispatch(
7681
'email_creditmemo_comment_set_template_vars_before',
77-
['sender' => $this, 'transport' => $transport]
82+
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
7883
);
7984

80-
$this->templateContainer->setTemplateVars($transport);
85+
$this->templateContainer->setTemplateVars($transportObject->getData());
8186

8287
return $this->checkAndSend($order, $notify);
8388
}

app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Sales\Model\ResourceModel\Order\Creditmemo as CreditmemoResource;
1515
use Magento\Sales\Model\Order\Address\Renderer;
1616
use Magento\Framework\Event\ManagerInterface;
17+
use Magento\Framework\DataObject;
1718

1819
/**
1920
* Class CreditmemoSender
@@ -102,7 +103,7 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false)
102103

103104
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
104105
$order = $creditmemo->getOrder();
105-
106+
106107
$transport = [
107108
'order' => $order,
108109
'creditmemo' => $creditmemo,
@@ -113,13 +114,17 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false)
113114
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
114115
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
115116
];
117+
$transportObject = new DataObject($transport);
116118

119+
/**
120+
* Event argument `transport` is @deprecated. Use `transportObject` instead.
121+
*/
117122
$this->eventManager->dispatch(
118123
'email_creditmemo_set_template_vars_before',
119-
['sender' => $this, 'transport' => $transport]
124+
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
120125
);
121126

122-
$this->templateContainer->setTemplateVars($transport);
127+
$this->templateContainer->setTemplateVars($transportObject->getData());
123128

124129
if ($this->checkAndSend($order)) {
125130
$creditmemo->setEmailSent(true);

0 commit comments

Comments
 (0)