Skip to content

Commit 915dfef

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #17291: fix: remove unused ID (by @DanielRuf) - #17191: [Backport 2.2]Filter test result collection with the cron job code defined in the c� (by @gelanivishal) - #16788: Replace sort callbacks to spaceship operator (by @lbajsarowicz) - #17275: fix #17193 Error with translation of confirmation modal buttons (by @Karlasa) - #17103: Code cleanup of lib files (by @mage2pratik) Fixed GitHub Issues: - #16243: Integration test ProcessCronQueueObserverTest.php succeeds regardless of magento config fixture (reported by @evktalo) has been fixed in #17191 by @gelanivishal in 2.2-develop branch Related commits: 1. ce5ac6e - #17193: Error with translation of confirmation modal buttons (reported by @delyriand) has been fixed in #17275 by @Karlasa in 2.2-develop branch Related commits: 1. 5cfde8a
2 parents 6f162dd + c130d01 commit 915dfef

File tree

57 files changed

+82
-124
lines changed

Some content is hidden

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

57 files changed

+82
-124
lines changed

app/code/Magento/Catalog/Model/Product/Type/AbstractType.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,7 @@ public function attributesCompare($attributeOne, $attributeTwo)
291291
$sortOne = $attributeOne->getGroupSortPath() * 1000 + $attributeOne->getSortPath() * 0.0001;
292292
$sortTwo = $attributeTwo->getGroupSortPath() * 1000 + $attributeTwo->getSortPath() * 0.0001;
293293

294-
if ($sortOne > $sortTwo) {
295-
return 1;
296-
} elseif ($sortOne < $sortTwo) {
297-
return -1;
298-
}
299-
300-
return 0;
294+
return $sortOne <=> $sortTwo;
301295
}
302296

303297
/**

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<element name="isPaymentSection" type="text" selector="//*[@class='opc-progress-bar']/li[contains(@class, '_active') and span[contains(.,'Review &amp; Payments')]]"/>
1313
<element name="availablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div:nth-child(2)>div.payment-method-title.field.choice"/>
1414
<element name="notAvailablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div.payment-method._active>div.payment-method-title.field.choice"/>
15-
<element name="billingNewAddressForm" type="text" selector=".billing-new-address-form"/>
15+
<element name="billingNewAddressForm" type="text" selector="[data-form='billing-new-address']"/>
1616
<element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/>
1717
<element name="update" type="button" selector=".payment-method-billing-address .action.action-update"/>
1818
<element name="guestFirstName" type="input" selector=".billing-address-form input[name*='firstname']"/>

app/code/Magento/Checkout/view/frontend/web/template/billing-address/form.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
<!-- ko template: getTemplate() --><!-- /ko -->
1010
<!--/ko-->
1111
<form data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
12-
<fieldset
13-
data-bind="attr: { id:'billing-new-address-form-'+index, value:index}"
14-
class="billing-new-address-form fieldset address">
12+
<fieldset class="fieldset address" data-form="billing-new-address">
1513
<!-- ko foreach: getRegion('additional-fieldsets') -->
1614
<!-- ko template: getTemplate() --><!-- /ko -->
1715
<!--/ko-->

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,7 @@ public function attributesCompare($firstAttribute, $secondAttribute)
602602
$firstSort = $firstAttribute->getSortWeight((int) $this->_sortingSetId);
603603
$secondSort = $secondAttribute->getSortWeight((int) $this->_sortingSetId);
604604

605-
if ($firstSort > $secondSort) {
606-
return 1;
607-
} elseif ($firstSort < $secondSort) {
608-
return -1;
609-
}
610-
611-
return 0;
605+
return $firstSort <=> $secondSort;
612606
}
613607

614608
/**

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,7 @@ public function getGroupedAllShippingRates()
872872
*/
873873
protected function _sortRates($firstItem, $secondItem)
874874
{
875-
if ((int)$firstItem[0]->carrier_sort_order < (int)$secondItem[0]->carrier_sort_order) {
876-
return -1;
877-
} elseif ((int)$firstItem[0]->carrier_sort_order > (int)$secondItem[0]->carrier_sort_order) {
878-
return 1;
879-
} else {
880-
return 0;
881-
}
875+
return (int) $firstItem[0]->carrier_sort_order <=> (int) $secondItem[0]->carrier_sort_order;
882876
}
883877

884878
/**

app/code/Magento/Sales/Model/Config/Ordered.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@ function ($a, $b) {
167167
if (!isset($a['sort_order']) || !isset($b['sort_order'])) {
168168
return 0;
169169
}
170-
if ($a['sort_order'] > $b['sort_order']) {
171-
return 1;
172-
} elseif ($a['sort_order'] < $b['sort_order']) {
173-
return -1;
174-
} else {
175-
return 0;
176-
}
170+
171+
return $a['sort_order'] <=> $b['sort_order'];
177172
}
178173
);
179174
}

app/code/Magento/Ui/view/base/web/js/modal/confirm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
define([
1010
'jquery',
1111
'underscore',
12+
'mage/translate',
1213
'jquery/ui',
13-
'Magento_Ui/js/modal/modal',
14-
'mage/translate'
15-
], function ($, _) {
14+
'Magento_Ui/js/modal/modal'
15+
], function ($, _, $t) {
1616
'use strict';
1717

1818
$.widget('mage.confirm', $.mage.modal, {
@@ -38,7 +38,7 @@ define([
3838
cancel: function () {}
3939
},
4040
buttons: [{
41-
text: $.mage.__('Cancel'),
41+
text: $t('Cancel'),
4242
class: 'action-secondary action-dismiss',
4343

4444
/**
@@ -48,7 +48,7 @@ define([
4848
this.closeModal(event);
4949
}
5050
}, {
51-
text: $.mage.__('OK'),
51+
text: $t('OK'),
5252
class: 'action-primary action-accept',
5353

5454
/**

dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ protected function setUp()
2727
}
2828

2929
/**
30-
* @magentoConfigFixture current_store crontab/default/jobs/catalog_product_alert/schedule/cron_expr 8 * * * *
30+
* @magentoConfigFixture current_store crontab/default/jobs/catalog_product_alert/schedule/cron_expr * * * * *
3131
*/
3232
public function testDispatchScheduled()
3333
{
3434
$collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
3535
\Magento\Cron\Model\ResourceModel\Schedule\Collection::class
3636
);
3737
$collection->addFieldToFilter('status', \Magento\Cron\Model\Schedule::STATUS_PENDING);
38+
$collection->addFieldToFilter('job_code', 'catalog_product_alert');
3839
$this->assertGreaterThan(0, $collection->count(), 'Cron has failed to schedule tasks for itself for future.');
3940
}
4041

lib/internal/Magento/Framework/Api/AbstractExtensibleObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getCustomAttribute($attributeCode)
7474
*/
7575
public function getCustomAttributes()
7676
{
77-
return isset($this->_data[self::CUSTOM_ATTRIBUTES]) ? $this->_data[self::CUSTOM_ATTRIBUTES] : [];
77+
return $this->_data[self::CUSTOM_ATTRIBUTES] ?? [];
7878
}
7979

8080
/**
@@ -129,7 +129,7 @@ public function setCustomAttribute($attributeCode, $attributeValue)
129129
*/
130130
protected function getCustomAttributesCodes()
131131
{
132-
return isset($this->customAttributesCodes) ? $this->customAttributesCodes : [];
132+
return $this->customAttributesCodes ?? [];
133133
}
134134

135135
/**

lib/internal/Magento/Framework/Api/AbstractSimpleObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(array $data = [])
3434
*/
3535
protected function _get($key)
3636
{
37-
return isset($this->_data[$key]) ? $this->_data[$key] : null;
37+
return $this->_data[$key] ?? null;
3838
}
3939

4040
/**

0 commit comments

Comments
 (0)