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

Commit e70975c

Browse files
authored
MAGETWO-80828: A solution for Product Repeat Issue after filter on category listing page. #11206
2 parents 338cf91 + df4905c commit e70975c

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ public function setCollection($collection)
192192
$this->_collection->setPageSize($limit);
193193
}
194194
if ($this->getCurrentOrder()) {
195-
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
195+
if (($this->getCurrentOrder()) == 'position') {
196+
$this->_collection->addAttributeToSort(
197+
$this->getCurrentOrder(),
198+
$this->getCurrentDirection()
199+
)->addAttributeToSort('entity_id', $this->getCurrentDirection());
200+
} else {
201+
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
202+
}
196203
}
197204
return $this;
198205
}

app/code/Magento/Wishlist/Model/Config.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ class Config
2222
/**
2323
* @var \Magento\Catalog\Model\Config
2424
*/
25-
private $_catalogConfig;
25+
private $catalogConfig;
2626

2727
/**
2828
* @var \Magento\Catalog\Model\Attribute\Config
2929
*/
30-
private $_attributeConfig;
30+
private $attributeConfig;
3131

3232
/**
3333
* Number of emails allowed for sharing wishlist
3434
*
3535
* @var int
3636
*/
37-
private $_sharingEmailLimit;
37+
private $sharingEmailLimit;
3838

3939
/**
4040
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
@@ -54,10 +54,10 @@ public function __construct(
5454
self::XML_PATH_SHARING_TEXT_LIMIT,
5555
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
5656
);
57-
$this->_sharingEmailLimit = $emailLimitInConfig ?: self::SHARING_EMAIL_LIMIT;
57+
$this->sharingEmailLimit = $emailLimitInConfig ?: self::SHARING_EMAIL_LIMIT;
5858
$this->_sharignTextLimit = $textLimitInConfig ?: self::SHARING_TEXT_LIMIT;
59-
$this->_catalogConfig = $catalogConfig;
60-
$this->_attributeConfig = $attributeConfig;
59+
$this->catalogConfig = $catalogConfig;
60+
$this->attributeConfig = $attributeConfig;
6161
}
6262

6363
/**
@@ -67,8 +67,8 @@ public function __construct(
6767
*/
6868
public function getProductAttributes()
6969
{
70-
$catalogAttributes = $this->_catalogConfig->getProductAttributes();
71-
$wishlistAttributes = $this->_attributeConfig->getAttributeNames('wishlist_item');
70+
$catalogAttributes = $this->catalogConfig->getProductAttributes();
71+
$wishlistAttributes = $this->attributeConfig->getAttributeNames('wishlist_item');
7272
return array_merge($catalogAttributes, $wishlistAttributes);
7373
}
7474

@@ -79,7 +79,7 @@ public function getProductAttributes()
7979
*/
8080
public function getSharingEmailLimit()
8181
{
82-
return $this->_sharingEmailLimit;
82+
return $this->sharingEmailLimit;
8383
}
8484

8585
/**

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerBackendEntity.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<testCase name="Magento\Customer\Test\TestCase\CreateExistingCustomerBackendEntity" summary="Create Existing Customer from Backend" ticketId="MAGETWO-43685">
1010
<variation name="CreateExistingCustomerBackendEntity1" summary="Create existing customer on Backend.">
1111
<data name="customer/dataset" xsi:type="string">default</data>
12+
<data name="issue" xsi:type="string">MAGETWO-81744: [Jenkins] Random fail of Requisition List Test and CreateExistingCustomerBackendEntity</data>
1213
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerBackendDuplicateErrorMessage" />
1314
</variation>
1415
</testCase>

0 commit comments

Comments
 (0)