Skip to content

Commit 770e8e8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-33568' into BUGS
2 parents edbff3c + 93e266f commit 770e8e8

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

app/code/Magento/Catalog/Helper/Product/Compare.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,9 @@ public function getRemoveUrl()
228228
*/
229229
public function getPostDataRemove($product)
230230
{
231-
$listCleanUrl = $this->getEncodedUrl($this->_getUrl('catalog/product_compare'));
232231
$data = [
233-
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $listCleanUrl,
234-
'product' => $product->getId()
232+
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => '',
233+
'product' => $product->getId(),
235234
];
236235
return $this->postHelper->getPostData($this->getRemoveUrl(), $data);
237236
}
@@ -253,9 +252,8 @@ public function getClearListUrl()
253252
*/
254253
public function getPostDataClearList()
255254
{
256-
$refererUrl = $this->_getRequest()->getServer('HTTP_REFERER');
257255
$params = [
258-
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($refererUrl)
256+
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => '',
259257
];
260258
return $this->postHelper->getPostData($this->getClearListUrl(), $params);
261259
}

app/code/Magento/Catalog/Test/Unit/Helper/Product/CompareTest.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,13 @@ public function testGetPostDataRemove()
113113
//Data
114114
$productId = 1;
115115
$removeUrl = 'catalog/product_compare/remove';
116-
$compareListUrl = 'catalog/product_compare';
117116
$postParams = [
118-
Action::PARAM_NAME_URL_ENCODED => strtr(base64_encode($compareListUrl), '+/=', '-_,'),
117+
Action::PARAM_NAME_URL_ENCODED => '',
119118
'product' => $productId
120119
];
121120

122121
//Verification
123-
$this->urlBuilder->expects($this->at(0))
124-
->method('getUrl')
125-
->with($compareListUrl)
126-
->will($this->returnValue($compareListUrl));
127-
$this->urlBuilder->expects($this->at(1))
122+
$this->urlBuilder->expects($this->once())
128123
->method('getUrl')
129124
->with($removeUrl)
130125
->will($this->returnValue($removeUrl));
@@ -159,18 +154,12 @@ public function testGetClearListUrl()
159154
public function testGetPostDataClearList()
160155
{
161156
//Data
162-
$refererUrl = 'home/';
163157
$clearUrl = 'catalog/product_compare/clear';
164158
$postParams = [
165-
Action::PARAM_NAME_URL_ENCODED => strtr(base64_encode($refererUrl), '+/=', '-_,')
159+
Action::PARAM_NAME_URL_ENCODED => ''
166160
];
167161

168162
//Verification
169-
$this->request->expects($this->once())
170-
->method('getServer')
171-
->with('HTTP_REFERER')
172-
->will($this->returnValue($refererUrl));
173-
174163
$this->urlBuilder->expects($this->once())
175164
->method('getUrl')
176165
->with($clearUrl)

0 commit comments

Comments
 (0)