Skip to content

Commit 8bfb6a0

Browse files
author
Magento CICD
authored
merge magento/2.3-develop into magento-borg/MAGETWO-90719-reorder-exception
2 parents 835e48a + 50503f2 commit 8bfb6a0

File tree

100 files changed

+1816
-823
lines changed

Some content is hidden

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

100 files changed

+1816
-823
lines changed

app/code/Magento/Catalog/Controller/Product/Compare/Add.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ public function execute()
3636
$productName = $this->_objectManager->get(
3737
\Magento\Framework\Escaper::class
3838
)->escapeHtml($product->getName());
39-
$this->messageManager->addSuccess(__('You added product %1 to the comparison list.', $productName));
39+
$this->messageManager->addComplexSuccessMessage(
40+
'addCompareSuccessMessage',
41+
[
42+
'product_name' => $productName,
43+
'compare_list_url' => $this->_url->getUrl('catalog/product_compare')
44+
]
45+
);
46+
4047
$this->_eventManager->dispatch('catalog_product_compare_add_product', ['product' => $product]);
4148
}
4249

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ protected function getSelect($entityIds = null, $type = null)
456456
$specialFromExpr = "{$specialFrom} IS NULL OR {$specialFromDate} <= {$currentDate}";
457457
$specialToExpr = "{$specialTo} IS NULL OR {$specialToDate} >= {$currentDate}";
458458
$specialPriceExpr = $connection->getCheckSql(
459-
"{$specialPrice} IS NOT NULL AND {$specialFromExpr} AND {$specialToExpr}",
459+
"{$specialPrice} IS NOT NULL AND ({$specialFromExpr}) AND ({$specialToExpr})",
460460
$specialPrice,
461461
$maxUnsignedBigint
462462
);

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="qtyInput" type="button" selector="input.input-text.qty"/>
1313
<element name="addToCartBtn" type="button" selector="button.action.tocart.primary" timeout="30"/>
1414
<element name="successMsg" type="button" selector="div.message-success"/>
15+
<element name="errorMsg" type="button" selector="div.message-error"/>
1516
<element name="alertMessage" type="text" selector=".page.messages [role=alert]"/>
1617
<element name="messagesBlock" type="text" selector=".page.messages"/>
1718
<element name="addToWishlist" type="button" selector="//a[@class='action towishlist']" timeout="30"/>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@
7979
<argument name="typeId" xsi:type="string">recently_compared_product</argument>
8080
</arguments>
8181
</virtualType>
82+
<type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
83+
<arguments>
84+
<argument name="configurationsMap" xsi:type="array">
85+
<item name="addCompareSuccessMessage" xsi:type="array">
86+
<item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item>
87+
<item name="data" xsi:type="array">
88+
<item name="template" xsi:type="string">Magento_Catalog::messages/addCompareSuccessMessage.phtml</item>
89+
</item>
90+
</item>
91+
</argument>
92+
</arguments>
93+
</type>
8294
<type name="Magento\Catalog\Block\Product\View\Gallery">
8395
<arguments>
8496
<argument name="galleryImagesConfig" xsi:type="array">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
// @codingStandardsIgnoreFile
7+
/** @var \Magento\Framework\View\Element\Template $block */
8+
?>
9+
<?= $block->escapeHtml(__(
10+
'You added product %1 to the <a href="%2">comparison list</a>.',
11+
$block->getData('product_name'),
12+
$block->getData('compare_list_url')),
13+
['a']
14+
);

app/code/Magento/CatalogUrlRewrite/Plugin/Store/Block/Switcher.php

Lines changed: 0 additions & 86 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<?php $methods = $block->getMethods('methods') ?: $block->getMethods('top_methods') ?>
1515
<ul class="checkout methods items checkout-methods-items">
1616
<?php foreach ($methods as $method): ?>
17-
<?php if ($methodHtml = $block->getMethodHtml($method)): ?>
17+
<?php $methodHtml = $block->getMethodHtml($method); ?>
18+
<?php if (trim($methodHtml) !== ''): ?>
1819
<li class="item"><?= /* @escapeNotVerified */ $methodHtml ?></li>
1920
<?php endif; ?>
2021
<?php endforeach; ?>

app/code/Magento/Contact/Controller/Index/Post.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Framework\App\Request\DataPersistorInterface;
1414
use Magento\Framework\Controller\Result\Redirect;
1515
use Magento\Framework\Exception\LocalizedException;
16-
use Magento\Framework\HTTP\PhpEnvironment\Request;
1716
use Psr\Log\LoggerInterface;
1817
use Magento\Framework\App\ObjectManager;
1918
use Magento\Framework\DataObject;
@@ -68,7 +67,7 @@ public function __construct(
6867
*/
6968
public function execute()
7069
{
71-
if (!$this->isPostRequest()) {
70+
if (!$this->getRequest()->isPost()) {
7271
return $this->resultRedirectFactory->create()->setPath('*/*/');
7372
}
7473
try {
@@ -102,16 +101,6 @@ private function sendEmail($post)
102101
);
103102
}
104103

105-
/**
106-
* @return bool
107-
*/
108-
private function isPostRequest()
109-
{
110-
/** @var Request $request */
111-
$request = $this->getRequest();
112-
return !empty($request->getPostValue());
113-
}
114-
115104
/**
116105
* @return array
117106
* @throws \Exception

app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ class PostTest extends \PHPUnit\Framework\TestCase
6565
*/
6666
private $mailMock;
6767

68+
/**
69+
* test setup
70+
*/
6871
protected function setUp()
6972
{
7073
$this->mailMock = $this->getMockBuilder(MailInterface::class)->getMockForAbstractClass();
@@ -78,7 +81,7 @@ protected function setUp()
7881
$this->createMock(\Magento\Framework\Message\ManagerInterface::class);
7982
$this->requestStub = $this->createPartialMock(
8083
\Magento\Framework\App\Request\Http::class,
81-
['getPostValue', 'getParams', 'getParam']
84+
['getPostValue', 'getParams', 'getParam', 'isPost']
8285
);
8386
$this->redirectResultMock = $this->createMock(\Magento\Framework\Controller\Result\Redirect::class);
8487
$this->redirectResultMock->method('setPath')->willReturnSelf();
@@ -120,13 +123,18 @@ protected function setUp()
120123
);
121124
}
122125

126+
/**
127+
* testExecuteEmptyPost
128+
*/
123129
public function testExecuteEmptyPost()
124130
{
125131
$this->stubRequestPostData([]);
126132
$this->assertSame($this->redirectResultMock, $this->controller->execute());
127133
}
128134

129135
/**
136+
* @param array $postData
137+
* @param bool $exceptionExpected
130138
* @dataProvider postDataProvider
131139
*/
132140
public function testExecutePostValidation($postData, $exceptionExpected)
@@ -159,6 +167,9 @@ public function postDataProvider()
159167
];
160168
}
161169

170+
/**
171+
* testExecuteValidPost
172+
*/
162173
public function testExecuteValidPost()
163174
{
164175
$post = ['name' => 'Name', 'comment' => 'Comment', 'email' => 'valid@mail.com', 'hideit' => null];
@@ -177,6 +188,10 @@ public function testExecuteValidPost()
177188
*/
178189
private function stubRequestPostData($post)
179190
{
191+
$this->requestStub
192+
->expects($this->once())
193+
->method('isPost')
194+
->willReturn(!empty($post));
180195
$this->requestStub->method('getPostValue')->willReturn($post);
181196
$this->requestStub->method('getParams')->willReturn($post);
182197
$this->requestStub->method('getParam')->willReturnCallback(

0 commit comments

Comments
 (0)