Skip to content

Commit 1ff3ca5

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #15891: Remove parameter from method calling (by @saurabh-aureate) - #15892: Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\D� (by @namratachangani) - #15888: Correct typo correction js files (by @saurabh-aureate) - #13862: Add compare list link to success message after adding a product (by @avstudnitz)
2 parents 9ba75c8 + aef96bb commit 1ff3ca5

File tree

8 files changed

+42
-9
lines changed

8 files changed

+42
-9
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/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\Framework\App\ResourceConnection">
8395
<plugin name="get_catalog_category_product_index_table_name" type="Magento\Catalog\Model\Indexer\Category\Product\Plugin\TableResolver"/>
8496
</type>
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/Catalog/view/frontend/web/js/storage-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ define([
129129
},
130130

131131
/**
132-
* Prepare storages congfig.
132+
* Prepare storages config.
133133
*
134134
* @returns {Object} Chainable.
135135
*/

app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ define([
133133

134134
/**
135135
* Retrieves from the list file which matches
136-
* search criteria implemented in itertor function.
136+
* search criteria implemented in iterator function.
137137
*
138138
* @param {Function} fn - Function that will be invoked
139139
* for each file in the list.
@@ -193,7 +193,7 @@ define([
193193
},
194194

195195
/**
196-
* Returns path to the files' preview image.
196+
* Returns path to the file's preview image.
197197
*
198198
* @param {Object} file
199199
* @returns {String}
@@ -310,7 +310,7 @@ define([
310310

311311
/**
312312
* Abstract handler which is invoked when files are choosed for upload.
313-
* May be used for implementation of aditional validation rules,
313+
* May be used for implementation of additional validation rules,
314314
* e.g. total files and a total size rules.
315315
*
316316
* @abstract

app/code/Magento/UrlRewrite/Block/Catalog/Product/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function _prepareLayoutFeatures()
5555
}
5656

5757
if ($this->_getProduct()->getId()) {
58-
$this->_addProductLinkBlock($this->_getProduct());
58+
$this->_addProductLinkBlock();
5959
}
6060

6161
if ($this->_getCategory()->getId()) {

dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testAddAction()
4949
);
5050

5151
$this->assertSessionMessages(
52-
$this->equalTo(['You added product Simple Product 1 Name to the comparison list.']),
52+
$this->equalTo(['You added product Simple Product 1 Name to the <a href="http://localhost/index.php/catalog/product_compare/">comparison list</a>.']),
5353
MessageInterface::TYPE_SUCCESS
5454
);
5555

lib/internal/Magento/Framework/Data/SearchResultProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ public function toArray($arrRequiredFields = [])
188188
}
189189

190190
/**
191-
* @param null $valueField
192-
* @param null $labelField
191+
* @param string|null $valueField
192+
* @param string|null $labelField
193193
* @param array $additional
194194
* @return array
195195
*/

0 commit comments

Comments
 (0)