Skip to content

Commit

Permalink
Merge pull request #1322 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests:
#8608
#9266
  • Loading branch information
Oleksii Korshenko authored Jul 12, 2017
2 parents 01ca787 + 9708638 commit 1c7ebea
Show file tree
Hide file tree
Showing 19 changed files with 409 additions and 187 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Pricing/Price/TierPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(
Session $customerSession,
GroupManagementInterface $groupManagement
) {
$quantity = $quantity ?: 1;
$quantity = floatval($quantity) ? $quantity : 1;
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
$this->customerSession = $customerSession;
$this->groupManagement = $groupManagement;
Expand Down
14 changes: 7 additions & 7 deletions app/code/Magento/Directory/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,14 @@ public function scheduledUpdateCurrencyRates($schedule)
}
}

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

$this->_transportBuilder->setTemplateIdentifier(
Expand All @@ -148,12 +153,7 @@ public function scheduledUpdateCurrencyRates($schedule)
self::XML_PATH_ERROR_IDENTITY,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
)
)->addTo(
$this->_scopeConfig->getValue(
self::XML_PATH_ERROR_RECIPIENT,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
)
);
)->addTo($errorRecipient);
$transport = $this->_transportBuilder->getTransport();
$transport->sendMessage();

Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ protected function prepareMessage()
$template = $this->getTemplate()->setData($this->templateData);
$this->setTemplateFilter($template);

$this->message->setMessageType(
\Magento\Framework\Mail\MessageInterface::TYPE_HTML
)->setBody(
$this->message->setBodyHtml(
$template->getProcessedTemplate($this->templateVars)
)->setSubject(
$template->getSubject()
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Newsletter/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class Template extends \Magento\Email\Model\AbstractTemplate
{
/**
* Mail object
*
* @deprecated Unused property
*
* @var \Zend_Mail
*/
protected $_mail;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ public function setUp()

/**
* @param int $templateType
* @param string $messageType
* @param string $bodyText
* @return void
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function testGetTransport(
$templateType = TemplateTypesInterface::TYPE_HTML,
$messageType = MessageInterface::TYPE_HTML,
$bodyText = '<h1>Html message</h1>'
) {
$filter = $this->getMock(\Magento\Email\Model\Template\Filter::class, [], [], '', false);
Expand Down Expand Up @@ -137,16 +135,7 @@ public function testGetTransport(
$this->messageMock->expects(
$this->once()
)->method(
'setMessageType'
)->with(
$this->equalTo($messageType)
)->will(
$this->returnSelf()
);
$this->messageMock->expects(
$this->once()
)->method(
'setBody'
'setBodyHtml'
)->with(
$this->equalTo($bodyText)
)->will(
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"zendframework/zend-validator": "^2.6.0",
"zendframework/zend-crypt": "^2.6.0",
"zendframework/zend-console": "^2.6.0",
"zendframework/zend-mail": "^2.8.0",
"zendframework/zend-modulemanager": "^2.7",
"zendframework/zend-mvc": "~2.6.3",
"zendframework/zend-text": "^2.6.0",
Expand Down
163 changes: 137 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c7ebea

Please sign in to comment.