Skip to content

Commit 9a28908

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #15292: Fix typo in property name (by @dmytro-ch) - #15291: [Backport] Fix typo in database column comment (by @VitaliyBoyko) - #15282: [fix] typo in private method name getUniq[ue]ImageIndex (by @mhauri) - #15269: Fix typo in Image::open exception message (by @t-richards) - #15133: Fix outdated address data when using Braintree's "Pay with PayPal" button (by @vovayatsyuk) - #15058: Add 'const' type support to layout arguments (by @IgorVitol)
2 parents 9644572 + 819c65e commit 9a28908

File tree

9 files changed

+60
-11
lines changed

9 files changed

+60
-11
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
define([
88
'jquery',
99
'underscore',
10+
'mage/utils/wrapper',
1011
'Magento_Checkout/js/view/payment/default',
1112
'Magento_Braintree/js/view/payment/adapter',
1213
'Magento_Checkout/js/model/quote',
@@ -18,6 +19,7 @@ define([
1819
], function (
1920
$,
2021
_,
22+
wrapper,
2123
Component,
2224
Braintree,
2325
quote,
@@ -218,8 +220,9 @@ define([
218220

219221
/**
220222
* Re-init PayPal Auth Flow
223+
* @param {Function} callback - Optional callback
221224
*/
222-
reInitPayPal: function () {
225+
reInitPayPal: function (callback) {
223226
if (Braintree.checkout) {
224227
Braintree.checkout.teardown(function () {
225228
Braintree.checkout = null;
@@ -228,6 +231,18 @@ define([
228231

229232
this.disableButton();
230233
this.clientConfig.paypal.amount = this.grandTotalAmount;
234+
this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();
235+
236+
if (callback) {
237+
this.clientConfig.onReady = wrapper.wrap(
238+
this.clientConfig.onReady,
239+
function (original, checkout) {
240+
this.clientConfig.onReady = original;
241+
original(checkout);
242+
callback();
243+
}.bind(this)
244+
);
245+
}
231246

232247
Braintree.setConfig(this.clientConfig);
233248
Braintree.setup();
@@ -404,15 +419,19 @@ define([
404419
* Triggers when customer click "Continue to PayPal" button
405420
*/
406421
payWithPayPal: function () {
407-
if (additionalValidators.validate()) {
422+
this.reInitPayPal(function () {
423+
if (!additionalValidators.validate()) {
424+
return;
425+
}
426+
408427
try {
409428
Braintree.checkout.paypal.initAuthFlow();
410429
} catch (e) {
411430
this.messageContainer.addErrorMessage({
412431
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
413432
});
414433
}
415-
}
434+
}.bind(this));
416435
},
417436

418437
/**

app/code/Magento/Catalog/Console/Command/ImagesResizeCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private function getViewImages(array $themes): array
216216
]);
217217
$images = $config->getMediaEntities('Magento_Catalog', ImageHelper::MEDIA_TYPE_CONFIG_NODE);
218218
foreach ($images as $imageId => $imageData) {
219-
$uniqIndex = $this->getUniqImageIndex($imageData);
219+
$uniqIndex = $this->getUniqueImageIndex($imageData);
220220
$imageData['id'] = $imageId;
221221
$viewImages[$uniqIndex] = $imageData;
222222
}
@@ -225,11 +225,11 @@ private function getViewImages(array $themes): array
225225
}
226226

227227
/**
228-
* Get uniq image index
228+
* Get unique image index
229229
* @param array $imageData
230230
* @return string
231231
*/
232-
private function getUniqImageIndex(array $imageData): string
232+
private function getUniqueImageIndex(array $imageData): string
233233
{
234234
ksort($imageData);
235235
unset($imageData['type']);

app/code/Magento/Catalog/Setup/InstallSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
674674
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
675675
null,
676676
['unsigned' => true, 'nullable' => false, 'default' => '0'],
677-
'Attriute Set ID'
677+
'Attribute Set ID'
678678
)
679679
->addColumn(
680680
'parent_id',

app/code/Magento/Ui/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
<type name="Magento\Framework\Data\Argument\Interpreter\Composite">
252252
<arguments>
253253
<argument name="interpreters" xsi:type="array">
254+
<item name="const" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Constant</item>
254255
<item name="object" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
255256
<item name="configurableObject" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
256257
<item name="array" xsi:type="object">arrayArgumentInterpreterProxy</item>

dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,24 @@ define([
2727
})
2828
},
2929
'Magento_Braintree/js/view/payment/adapter': {
30+
config: {},
31+
32+
/** Stub */
33+
onReady: function () {},
34+
35+
/** Stub */
36+
setConfig: function (config) {
37+
this.config = config;
38+
},
39+
40+
/** Stub */
41+
setup: function () {
42+
this.config.onReady(this.checkout);
43+
},
44+
3045
checkout: {
46+
/** Stub */
47+
teardown: function () {},
3148
paypal: {
3249
/** Stub */
3350
initAuthFlow: function () {}

dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ControllerAclTest extends \PHPUnit\Framework\TestCase
3131
*
3232
* @var array
3333
*/
34-
private $whiteListetBackendControllers = [];
34+
private $whiteListedBackendControllers = [];
3535

3636
/**
3737
* List of ACL resources collected from acl.xml files.
@@ -57,7 +57,7 @@ protected function setUp()
5757
if (substr($item, 0, 1) === '#') {
5858
continue;
5959
}
60-
$this->whiteListetBackendControllers[$item] = 1;
60+
$this->whiteListedBackendControllers[$item] = 1;
6161
}
6262
}
6363

@@ -83,7 +83,7 @@ public function testAcl()
8383

8484
$controllerClass = $this->getClassByFilePath($controllerPath);
8585
// skip whitelisted controllers.
86-
if (isset($this->whiteListetBackendControllers[$controllerClass->getName()])) {
86+
if (isset($this->whiteListedBackendControllers[$controllerClass->getName()])) {
8787
continue;
8888
}
8989
// we don't have to check abstract classes.

lib/internal/Magento/Framework/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function open()
4949
$this->_adapter->checkDependencies();
5050

5151
if (!file_exists($this->_fileName)) {
52-
throw new \Exception("File '{$this->_fileName}' does not exists.");
52+
throw new \Exception("File '{$this->_fileName}' does not exist.");
5353
}
5454

5555
$this->_adapter->open($this->_fileName);

lib/internal/Magento/Framework/View/Layout/etc/layout_merged.xsd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,10 @@
6262
</xs:extension>
6363
</xs:complexContent>
6464
</xs:complexType>
65+
66+
<xs:complexType name="const">
67+
<xs:complexContent>
68+
<xs:extension base="argumentType" />
69+
</xs:complexContent>
70+
</xs:complexType>
6571
</xs:schema>

lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@
3232
<xs:field xpath="@name"/>
3333
</xs:unique>
3434
</xs:element>
35+
36+
<xs:complexType name="const">
37+
<xs:complexContent>
38+
<xs:extension base="argumentType" />
39+
</xs:complexContent>
40+
</xs:complexType>
3541
</xs:schema>

0 commit comments

Comments
 (0)