Skip to content

Commit 448f9b2

Browse files
committed
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-39-PR
2 parents 8613f2c + a0428fe commit 448f9b2

File tree

8 files changed

+55
-49
lines changed

8 files changed

+55
-49
lines changed

app/code/Magento/Checkout/etc/frontend/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<arguments>
3434
<argument name="clientSideSections" xsi:type="array">
3535
<item name="checkout-data" xsi:type="string">checkout-data</item>
36+
<item name="cart-data" xsi:type="string">cart-data</item>
3637
</argument>
3738
</arguments>
3839
</type>

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ public function getStreetLine($number)
230230
*/
231231
public function getStreetFull()
232232
{
233-
return $this->getData('street');
233+
$street = $this->getData('street');
234+
return is_array($street) ? implode("\n", $street) : $street;
234235
}
235236

236237
/**

app/code/Magento/Customer/Model/EmailNotification.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@ class EmailNotification implements EmailNotificationInterface
6060
self::NEW_ACCOUNT_EMAIL_CONFIRMATION => self::XML_PATH_CONFIRM_EMAIL_TEMPLATE,
6161
];
6262

63-
/**
64-
* Map of templates. Use for backward compatibility
65-
*/
66-
const TEMPLATE_MAP = [
67-
self::XML_PATH_FORGOT_EMAIL_TEMPLATE => self::XML_PATH_RESET_PASSWORD_TEMPLATE
68-
];
69-
7063
/**#@-*/
7164

7265
/**
@@ -248,7 +241,7 @@ private function sendEmailTemplate(
248241
$storeId = null,
249242
$email = null
250243
) {
251-
$templateId = $this->getTemplateId($template, 'store', $storeId);
244+
$templateId = $this->scopeConfig->getValue($template, 'store', $storeId);
252245
if ($email === null) {
253246
$email = $customer->getEmail();
254247
}
@@ -384,23 +377,4 @@ public function newAccount(
384377
$storeId
385378
);
386379
}
387-
388-
/**
389-
* Get templateId include considering template map
390-
*
391-
* @param string $template
392-
* @param string $scopeType
393-
* @param string $storeId
394-
* @return string
395-
*/
396-
private function getTemplateId($template, $scopeType, $storeId)
397-
{
398-
if (array_key_exists($template, self::TEMPLATE_MAP)) {
399-
$templateId = $this->scopeConfig->getValue(self::TEMPLATE_MAP[$template], $scopeType, $storeId);
400-
if ($templateId) {
401-
return $templateId;
402-
}
403-
}
404-
return $this->scopeConfig->getValue($template, $scopeType, $storeId);
405-
}
406380
}

app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,27 @@ public function validateDataProvider()
377377
'validated' => [array_merge($data, ['country_id' => $countryId++]), true],
378378
];
379379
}
380+
381+
/**
382+
* @dataProvider getStreetFullDataProvider
383+
*/
384+
public function testGetStreetFullAlwaysReturnsString($expectedResult, $street)
385+
{
386+
$this->model->setData('street', $street);
387+
$this->assertEquals($expectedResult, $this->model->getStreetFull());
388+
}
389+
390+
/**
391+
* @return array
392+
*/
393+
public function getStreetFullDataProvider()
394+
{
395+
return [
396+
[null, null],
397+
['', []],
398+
["first line\nsecond line", ['first line', 'second line']],
399+
['single line', ['single line']],
400+
['single line', 'single line'],
401+
];
402+
}
380403
}

app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public function testPasswordResetConfirmation()
545545

546546
$this->scopeConfigMock->expects($this->at(0))
547547
->method('getValue')
548-
->with(EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE, ScopeInterface::SCOPE_STORE, $customerStoreId)
548+
->with(EmailNotification::XML_PATH_FORGOT_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE, $customerStoreId)
549549
->willReturn($templateIdentifier);
550550
$this->scopeConfigMock->expects($this->at(1))
551551
->method('getValue')

app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/popup.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
2121
"Magento_Ui/js/modal/modal"
2222
], function(jQuery){
2323

24-
packaging = new Packaging(<?= /* @escapeNotVerified */ $block->getConfigDataJson() ?>);
24+
window.packaging = new Packaging(<?= /* @escapeNotVerified */ $block->getConfigDataJson() ?>);
2525
packaging.changeContainerType($$('select[name=package_container]')[0]);
2626
packaging.checkSizeAndGirthParameter(
2727
$$('select[name=package_container]')[0],
@@ -76,6 +76,8 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
7676
}
7777
}]
7878
});
79+
jQuery(document).trigger('packaging:inited');
80+
jQuery(document).data('packagingInited', true);
7981
});
8082
</script>
8183
<?php include ($block->getTemplateFile('Magento_Shipping::order/packaging/popup_content.phtml')) ?>

app/code/Magento/Shipping/view/adminhtml/templates/view/form.phtml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,30 @@
7070
<?= $block->getChildHtml('shipment_tracking') ?>
7171

7272
<?= $block->getChildHtml('shipment_packaging') ?>
73-
<script>
74-
require([
75-
'prototype'
76-
], function () {
73+
<script>
74+
require([
75+
'jquery',
76+
'prototype'
77+
], function (jQuery) {
78+
var setCallbacks = function () {
79+
window.packaging.setConfirmPackagingCallback(function () {
80+
window.packaging.sendCreateLabelRequest();
81+
});
82+
window.packaging.setLabelCreatedCallback(function () {
83+
setLocation("<?php /* @escapeNotVerified */ echo $block->getUrl(
84+
'adminhtml/order_shipment/view',
85+
['shipment_id' => $block->getShipment()->getId()]
86+
); ?>");
87+
});
88+
};
7789

78-
setTimeout(function () {
79-
packaging.setConfirmPackagingCallback(function () {
80-
packaging.sendCreateLabelRequest();
81-
});
82-
packaging.setLabelCreatedCallback(function (response) {
83-
setLocation("<?php /* @escapeNotVerified */ echo $block->getUrl(
84-
'adminhtml/order_shipment/view',
85-
['shipment_id' => $block->getShipment()->getId()]
86-
); ?>");
87-
});
88-
}, 500);
89-
90-
});
91-
</script>
90+
if (jQuery(document).data('packagingInited')) {
91+
setCallbacks();
92+
} else {
93+
jQuery(document).on('packaging:inited', setCallbacks);
94+
}
95+
});
96+
</script>
9297
</div>
9398
</div>
9499
</div>

dev/travis/before_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ case $TEST_SUITE in
7171
--output-file="$changed_files_ce" \
7272
--base-path="$TRAVIS_BUILD_DIR" \
7373
--repo='https://github.com/magento/magento2.git' \
74-
--branch='develop'
74+
--branch='$TRAVIS_BRANCH'
7575
cat "$changed_files_ce" | sed 's/^/ + including /'
7676

7777
cd ../../..

0 commit comments

Comments
 (0)