Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit bec2fde

Browse files
committed
MAGETWO-87351: [EngCom Team] Batch 23. Forwardports to 2.3-develop #1325
- Merge Pull Request magento-engcom/magento2ce#1325 from magento-engcom-team/magento2:batch-23-forwardport-2.3-develop - Merged commits: 1. e84cb3e 2. 742819b 3. cc2b11f 4. ae8b187 5. 35b3c02 6. eae8936 7. 90e4923 8. b098dbc 9. e8e4cdd 10. 058e5e5 11. 9368d5d 12. bf19409 13. a15ec34 14. 9e4ce76 15. 0995681 16. 6772a2d 17. b0d6bfc 18. b037357 19. 8de5951
2 parents 3881f04 + 8de5951 commit bec2fde

File tree

16 files changed

+266
-20
lines changed

16 files changed

+266
-20
lines changed

app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function _prepareCollection()
9292
protected function _afterLoadCollection()
9393
{
9494
foreach ($this->getCollection() as $item) {
95-
$item->getCustomer() ?: $item->setCustomer('Guest');
95+
$item->getCustomer() ?: $item->setCustomer($item->getBillingAddress()->getName());
9696
}
9797
return $this;
9898
}

app/code/Magento/Checkout/view/frontend/templates/cart/coupon.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="field">
2525
<label for="coupon_code" class="label"><span><?= /* @escapeNotVerified */ __('Enter discount code') ?></span></label>
2626
<div class="control">
27-
<input type="text" class="input-text" id="coupon_code" name="coupon_code" value="<?= $block->escapeHtml($block->getCouponCode()) ?>" placeholder="<?= $block->escapeHtml(__('Enter discount code')) ?>" />
27+
<input type="text" class="input-text" id="coupon_code" name="coupon_code" value="<?= $block->escapeHtml($block->getCouponCode()) ?>" placeholder="<?= $block->escapeHtml(__('Enter discount code')) ?>" <?php if (strlen($block->getCouponCode())): ?> disabled="disabled" <?php endif; ?> />
2828
</div>
2929
</div>
3030
<div class="actions-toolbar">

app/code/Magento/Indexer/Model/Message/Invalid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function getText()
7171
return __(
7272
'One or more <a href="%1">indexers are invalid</a>. Make sure your <a href="%2" target="_blank">Magento cron job</a> is running.',
7373
$url,
74-
'http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg'
74+
'http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab'
7575
);
7676
//@codingStandardsIgnoreEnd
7777
}

app/code/Magento/Payment/view/adminhtml/templates/info/substitution.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*/
1111
?>
1212
<div>
13-
<?php $block->escapeHtml($block->getMethod()->getTitle());?>
13+
<?= $block->getMethod()->getTitle()
14+
? $block->escapeHtml($block->getMethod()->getTitle())
15+
: $block->escapeHtml(__('Payment method')); ?>
1416
<?= $block->escapeHtml(__(' is not available. You still can process offline actions.')) ?>
1517
</div>

app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
*/
66
namespace Magento\Sales\Model\Order\Email;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\Mail\Template\TransportBuilder;
10+
use Magento\Framework\Mail\Template\TransportBuilderByStore;
911
use Magento\Sales\Model\Order\Email\Container\IdentityInterface;
1012
use Magento\Sales\Model\Order\Email\Container\Template;
1113

@@ -26,19 +28,29 @@ class SenderBuilder
2628
*/
2729
protected $transportBuilder;
2830

31+
/**
32+
* @var TransportBuilderByStore
33+
*/
34+
private $transportBuilderByStore;
35+
2936
/**
3037
* @param Template $templateContainer
3138
* @param IdentityInterface $identityContainer
3239
* @param TransportBuilder $transportBuilder
40+
* @param TransportBuilderByStore $transportBuilderByStore
3341
*/
3442
public function __construct(
3543
Template $templateContainer,
3644
IdentityInterface $identityContainer,
37-
TransportBuilder $transportBuilder
45+
TransportBuilder $transportBuilder,
46+
TransportBuilderByStore $transportBuilderByStore = null
3847
) {
3948
$this->templateContainer = $templateContainer;
4049
$this->identityContainer = $identityContainer;
4150
$this->transportBuilder = $transportBuilder;
51+
$this->transportBuilderByStore = $transportBuilderByStore ?: ObjectManager::getInstance()->get(
52+
TransportBuilderByStore::class
53+
);
4254
}
4355

4456
/**
@@ -98,6 +110,9 @@ protected function configureEmailTemplate()
98110
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
99111
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
100112
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
101-
$this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());
113+
$this->transportBuilderByStore->setFromByStore(
114+
$this->identityContainer->getEmailIdentity(),
115+
$this->identityContainer->getStore()->getId()
116+
);
102117
}
103118
}

app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Sales\Test\Unit\Model\Order\Email;
78

9+
use Magento\Framework\Mail\Template\TransportBuilderByStore;
810
use Magento\Sales\Model\Order\Email\SenderBuilder;
911

1012
class SenderBuilderTest extends \PHPUnit\Framework\TestCase
@@ -29,6 +31,16 @@ class SenderBuilderTest extends \PHPUnit\Framework\TestCase
2931
*/
3032
protected $transportBuilder;
3133

34+
/**
35+
* @var \PHPUnit_Framework_MockObject_MockObject
36+
*/
37+
private $storeMock;
38+
39+
/**
40+
* @var \PHPUnit_Framework_MockObject_MockObject
41+
*/
42+
private $transportBuilderByStore;
43+
3244
protected function setUp()
3345
{
3446
$templateId = 'test_template_id';
@@ -42,7 +54,11 @@ protected function setUp()
4254
['getTemplateVars', 'getTemplateOptions', 'getTemplateId']
4355
);
4456

45-
$this->storeMock = $this->createPartialMock(\Magento\Store\Model\Store::class, ['getStoreId', '__wakeup']);
57+
$this->storeMock = $this->createPartialMock(\Magento\Store\Model\Store::class, [
58+
'getStoreId',
59+
'__wakeup',
60+
'getId',
61+
]);
4662

4763
$this->identityContainerMock = $this->createPartialMock(
4864
\Magento\Sales\Model\Order\Email\Container\ShipmentIdentity::class,
@@ -52,15 +68,24 @@ protected function setUp()
5268
'getCustomerName',
5369
'getTemplateOptions',
5470
'getEmailCopyTo',
55-
'getCopyMethod'
71+
'getCopyMethod',
72+
'getStore',
5673
]
5774
);
5875

59-
$this->transportBuilder = $this->createPartialMock(\Magento\Framework\Mail\Template\TransportBuilder::class, [
60-
'addTo', 'addBcc', 'getTransport',
61-
'setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars',
62-
'setFrom',
63-
]);
76+
$this->transportBuilder = $this->createPartialMock(
77+
\Magento\Framework\Mail\Template\TransportBuilder::class,
78+
[
79+
'addTo',
80+
'addBcc',
81+
'getTransport',
82+
'setTemplateIdentifier',
83+
'setTemplateOptions',
84+
'setTemplateVars',
85+
]
86+
);
87+
88+
$this->transportBuilderByStore = $this->createMock(TransportBuilderByStore::class);
6489

6590
$this->templateContainerMock->expects($this->once())
6691
->method('getTemplateId')
@@ -84,8 +109,8 @@ protected function setUp()
84109
$this->identityContainerMock->expects($this->once())
85110
->method('getEmailIdentity')
86111
->will($this->returnValue($emailIdentity));
87-
$this->transportBuilder->expects($this->once())
88-
->method('setFrom')
112+
$this->transportBuilderByStore->expects($this->once())
113+
->method('setFromByStore')
89114
->with($this->equalTo($emailIdentity));
90115

91116
$this->identityContainerMock->expects($this->once())
@@ -95,7 +120,8 @@ protected function setUp()
95120
$this->senderBuilder = new SenderBuilder(
96121
$this->templateContainerMock,
97122
$this->identityContainerMock,
98-
$this->transportBuilder
123+
$this->transportBuilder,
124+
$this->transportBuilderByStore
99125
);
100126
}
101127

@@ -119,6 +145,12 @@ public function testSend()
119145
$this->identityContainerMock->expects($this->once())
120146
->method('getCustomerName')
121147
->will($this->returnValue($customerName));
148+
$this->identityContainerMock->expects($this->once())
149+
->method('getStore')
150+
->willReturn($this->storeMock);
151+
$this->storeMock->expects($this->once())
152+
->method('getId')
153+
->willReturn(1);
122154
$this->transportBuilder->expects($this->once())
123155
->method('addTo')
124156
->with($this->equalTo($customerEmail), $this->equalTo($customerName));
@@ -145,7 +177,12 @@ public function testSendCopyTo()
145177
$this->transportBuilder->expects($this->once())
146178
->method('addTo')
147179
->with($this->equalTo('[email protected]'));
148-
180+
$this->identityContainerMock->expects($this->once())
181+
->method('getStore')
182+
->willReturn($this->storeMock);
183+
$this->storeMock->expects($this->once())
184+
->method('getId')
185+
->willReturn(1);
149186
$this->transportBuilder->expects($this->once())
150187
->method('getTransport')
151188
->will($this->returnValue($transportMock));

app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
id="discount-code"
2828
name="discount_code"
2929
data-validate="{'required-entry':true}"
30-
data-bind="value: couponCode, attr:{placeholder: $t('Enter discount code')} " />
30+
data-bind="value: couponCode, attr:{disabled:isApplied() , placeholder: $t('Enter discount code')} " />
3131
</div>
3232
</div>
3333
</div>

app/code/Magento/Ui/view/base/web/js/form/element/region.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ define([
3535
return;
3636
}
3737
option = options[value];
38+
39+
if (typeof option === 'undefined') {
40+
return;
41+
}
42+
3843
defaultPostCodeResolver.setUseDefaultPostCode(!option['is_zipcode_optional']);
3944

4045
if (this.skipValidation) {

app/design/adminhtml/Magento/backend/web/css/source/_structure.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ body {
3636
// ToDo UI: should be moved to messages
3737
.notices-wrapper {
3838
margin: 0 3rem;
39+
min-height: 5rem;
3940
.messages {
4041
margin-bottom: 0;
4142
}

app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,16 @@
497497
}
498498
}
499499

500+
//
501+
// Category page 1 column layout
502+
// ---------------------------------------------
503+
504+
.catalog-category-view.page-layout-1column {
505+
.column.main {
506+
min-height: inherit;
507+
}
508+
}
509+
500510
}
501511

502512
//

0 commit comments

Comments
 (0)