Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #20954: [Backport] #18698 Fixed order email sending via order async email sending when order was created with disabled email sending (by @serhiyzhovnir)
 - #20781: [Backport] cms-page-top-spacing-issue-2.2 (by @amol2jcommerce)
 - #21242: [Backport] bundle-product-table-data-grouped-alignment :: Bundle product table d� (by @amol2jcommerce)
 - #21247: [Backport] Assign with and, or, replaced by &&, || (by @Dharmeshvaja91)
 - #21164: [Backport] Solved swagger response of product attribute option is_default (by @mage2pratik)


Fixed GitHub Issues:
 - #18698: Magento triggers and sends some of order emails exactly one month later,while the order email was not enabled then (reported by @PiroozMB) has been fixed in #20954 by @serhiyzhovnir in 2.2-develop branch
   Related commits:
     1. 9b6ef59
     2. d70186b

 - #20755: cms page top spacing issue at mobile (reported by @priti2jcommerce) has been fixed in #20781 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. 7383946

 - #18525: Incorrect Swager Definition for eav-data-attribute-option-interface  (reported by @vetshopdeveloper) has been fixed in #21164 by @mage2pratik in 2.2-develop branch
   Related commits:
     1. 11cafc3
     2. c1f3f36
     3. 7b8ec80
  • Loading branch information
magento-engcom-team authored Feb 18, 2019
2 parents d18c713 + aa8dfb0 commit 6d856c4
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
{
$adminValues = [];
foreach ($optionsValues as $optionKey => $values) {
if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
$adminValues[] = reset($values);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private function addDefaultCountryToOptions(array &$options)

foreach ($options as $key => $option) {
if (isset($defaultCountry[$option['value']])) {
$options[$key]['is_default'] = $defaultCountry[$option['value']];
$options[$key]['is_default'] = !empty($defaultCountry[$option['value']]);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function execute()
/** @var Quote $quote */
$quote = $this->sessionManager->getQuote();

if (!$quote or !$quote instanceof Quote) {
if (!$quote || !$quote instanceof Quote) {
return $this->getErrorResponse();
}

Expand All @@ -106,6 +106,8 @@ public function execute()
}

/**
* Get error response.
*
* @return Json
*/
private function getErrorResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct(
*/
public function send(Order $order, $forceSyncMode = false)
{
$order->setSendEmail(true);
$order->setSendEmail($this->identityContainer->isEnabled());

if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
if ($this->checkAndSend($order)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult, $sen

$this->orderMock->expects($this->once())
->method('setSendEmail')
->with(true);
->with($emailSendingResult);

$this->globalConfig->expects($this->once())
->method('getValue')
->with($configPath)
->willReturn($configValue);

if (!$configValue || $forceSyncMode) {
$this->identityContainerMock->expects($this->once())
$this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);

Expand Down Expand Up @@ -118,7 +118,7 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult, $sen

$this->orderMock->expects($this->once())
->method('setEmailSent')
->with(true);
->with($emailSendingResult);

$this->orderResourceMock->expects($this->once())
->method('saveAttribute')
Expand Down Expand Up @@ -210,7 +210,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
->with('sales_email/general/async_sending')
->willReturn(false);

$this->identityContainerMock->expects($this->once())
$this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn(true);

Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Security/Model/SecurityChecker/Quantity.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function check($securityEventType, $accountReference = null, $longIp = null)
{
$isEnabled = $this->securityConfig->getPasswordResetProtectionType() != ResetMethod::OPTION_NONE;
$allowedAttemptsNumber = $this->securityConfig->getMaxNumberPasswordResetRequests();
if ($isEnabled and $allowedAttemptsNumber) {
if ($isEnabled && $allowedAttemptsNumber) {
$collection = $this->prepareCollection($securityEventType, $accountReference, $longIp);
if ($collection->count() >= $allowedAttemptsNumber) {
throw new SecurityViolationException(
Expand Down
15 changes: 9 additions & 6 deletions app/code/Magento/SendFriend/Model/SendFriend.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @method \Magento\SendFriend\Model\SendFriend setTime(int $value)
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*
* @api
Expand Down Expand Up @@ -162,6 +163,8 @@ protected function _construct()
}

/**
* Send email.
*
* @return $this
* @throws CoreException
*/
Expand Down Expand Up @@ -236,7 +239,7 @@ public function validate()
}

$email = $this->getSender()->getEmail();
if (empty($email) or !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
if (empty($email) || !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
$errors[] = __('Invalid Sender Email');
}

Expand Down Expand Up @@ -281,13 +284,13 @@ public function setRecipients($recipients)
// validate array
if (!is_array(
$recipients
) or !isset(
) || !isset(
$recipients['email']
) or !isset(
) || !isset(
$recipients['name']
) or !is_array(
) || !is_array(
$recipients['email']
) or !is_array(
) || !is_array(
$recipients['name']
)
) {
Expand Down Expand Up @@ -487,7 +490,7 @@ protected function _sentCountByCookies($increment = false)
$oldTimes = explode(',', $oldTimes);
foreach ($oldTimes as $oldTime) {
$periodTime = $time - $this->_sendfriendData->getPeriod();
if (is_numeric($oldTime) and $oldTime >= $periodTime) {
if (is_numeric($oldTime) && $oldTime >= $periodTime) {
$newTimes[] = $oldTime;
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function processExtraTaxables(Address\Total $total, array $itemsByType
{
$extraTaxableDetails = [];
foreach ($itemsByType as $itemType => $itemTaxDetails) {
if ($itemType != self::ITEM_TYPE_PRODUCT and $itemType != self::ITEM_TYPE_SHIPPING) {
if ($itemType != self::ITEM_TYPE_PRODUCT && $itemType != self::ITEM_TYPE_SHIPPING) {
foreach ($itemTaxDetails as $itemCode => $itemTaxDetail) {
/** @var \Magento\Tax\Api\Data\TaxDetailsInterface $taxDetails */
$taxDetails = $itemTaxDetail[self::KEY_ITEM];
Expand Down Expand Up @@ -407,6 +407,7 @@ protected function enhanceTotalData(

/**
* Process model configuration array.
*
* This method can be used for changing totals collect sort order
*
* @param array $config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ define([

if (!this.value()) {
defaultCountry = _.filter(result, function (item) {
return item['is_default'] && item['is_default'].includes(value);
return item['is_default'] && _.contains(item['is_default'], value);
});

if (defaultCountry.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,18 @@
}

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.table-wrapper.grouped {
.lib-css(margin-left, -@layout__width-xs-indent);
.lib-css(margin-right, -@layout__width-xs-indent);
.product-add-form {
.table-wrapper.grouped {
.lib-css(margin-left, -@layout__width-xs-indent);
.lib-css(margin-right, -@layout__width-xs-indent);
.table.data.grouped {
tr {
td {
padding: 5px 10px 5px 15px;
}
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.cms-page-view .page-main {
padding-top: 41px;
padding-top: 0;
position: relative;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private function assertClassesExist($classes, $path)
foreach ($classes as $class) {
$class = trim($class, '\\');
try {
if (strrchr($class, '\\') === false and !Classes::isVirtual($class)) {
if (strrchr($class, '\\') === false && !Classes::isVirtual($class)) {
$badUsages[] = $class;
continue;
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Filter/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function templateDirective($construction)
{
// Processing of {template config_path=... [...]} statement
$templateParameters = $this->getParameters($construction[2]);
if (!isset($templateParameters['config_path']) or !$this->getTemplateProcessor()) {
if (!isset($templateParameters['config_path']) || !$this->getTemplateProcessor()) {
// Not specified template or not set include processor
$replacedValue = '{Error in template processing}';
} else {
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/Magento/Framework/Message/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Message manager model
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Manager implements ManagerInterface
Expand Down Expand Up @@ -226,7 +228,7 @@ public function addUniqueMessages(array $messages, $group = null)
$items = $this->getMessages(false, $group)->getItems();

foreach ($messages as $message) {
if ($message instanceof MessageInterface and !in_array($message, $items, false)) {
if ($message instanceof MessageInterface && !in_array($message, $items, false)) {
$this->addMessage($message, $group);
}
}
Expand Down
8 changes: 4 additions & 4 deletions setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Session implements ConfigOptionsListInterface
];

/**
* {@inheritdoc}
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function getOptions()
Expand Down Expand Up @@ -250,7 +250,7 @@ public function getOptions()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createConfig(array $options, DeploymentConfig $deploymentConfig)
{
Expand Down Expand Up @@ -281,7 +281,7 @@ public function createConfig(array $options, DeploymentConfig $deploymentConfig)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function validate(array $options, DeploymentConfig $deploymentConfig)
{
Expand All @@ -301,7 +301,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)

if (isset($options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL])) {
$level = $options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL];
if (($level < 0) or ($level > 7)) {
if (($level < 0) || ($level > 7)) {
$errors[] = "Invalid Redis log level '{$level}'. Valid range is 0-7, inclusive.";
}
}
Expand Down

0 comments on commit 6d856c4

Please sign in to comment.