Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 6155: blShowSorting used for frontend user sorting #431

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 10 additions & 14 deletions source/Application/Component/Locator.php
Expand Up @@ -96,11 +96,9 @@ protected function _setListLocatorData($oLocatorTarget, $oCurrArticle)
{
// if no active category is loaded - lets check for category passed by post/get
if (($oCategory = $oLocatorTarget->getActiveCategory())) {

$sOrderBy = null;
if ($oLocatorTarget->showSorting()) {
$sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
}

// Bug 6155: blShowSorting is set in the backend only to allow/deny sorting by user in the frontend - "Users can sort Product Lists"
$sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());

$oIdList = $this->_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);

Expand Down Expand Up @@ -150,9 +148,9 @@ protected function _setVendorLocatorData($oLocatorTarget, $oCurrArticle)

// loading data for article navigation
$oIdList = oxNew("oxArticleList");
if ($oLocatorTarget->showSorting()) {
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
}

// Bug 6155: blShowSorting is set in the backend only to allow/deny sorting by user in the frontend - "Users can sort Product Lists"
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadVendorIds($sVendorId);

//page number
Expand Down Expand Up @@ -196,9 +194,8 @@ protected function _setManufacturerLocatorData($oLocatorTarget, $oCurrArticle)

// loading data for article navigation
$oIdList = oxNew("oxArticleList");
if ($oLocatorTarget->showSorting()) {
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
}
// Bug 6155: blShowSorting is set in the backend only to allow/deny sorting by user in the frontend - "Users can sort Product Lists"
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadManufacturerIds($sManufacturerId);

//page number
Expand Down Expand Up @@ -262,9 +259,8 @@ protected function _setSearchLocatorData($oLocatorTarget, $oCurrArticle)

// loading data for article navigation
$oIdList = oxNew('oxArticleList');
if ($oLocatorTarget->showSorting()) {
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
}
// Bug 6155: blShowSorting is set in the backend only to allow/deny sorting by user in the frontend - "Users can sort Product Lists"
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadSearchIds($sSearchParam, $sSearchCat, $sSearchVendor, $sSearchManufacturer);

//page number
Expand Down
10 changes: 0 additions & 10 deletions tests/Unit/Application/Controller/LocatorTest.php
Expand Up @@ -186,7 +186,6 @@ public function testSetListLocatorData()
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActiveCategory')->will($this->returnValue($oCategory));
$oLocatorTarget->expects($this->once())->method('getCategoryTree')->will($this->returnValue(oxNew('oxcategorylist')));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_CATEGORY));

$oLocator = new testOxLocator();
Expand Down Expand Up @@ -223,7 +222,6 @@ public function testSetListLocatorDataSeo()
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActiveCategory')->will($this->returnValue($oCategory));
$oLocatorTarget->expects($this->once())->method('getCategoryTree')->will($this->returnValue(oxNew('oxcategorylist')));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_CATEGORY));

$oConfig = $this->getMock('oxconfig', array('getConfigParam'));
Expand Down Expand Up @@ -285,7 +283,6 @@ public function testSetVendorLocatorData()
$oLocatorTarget->expects($this->any())->method('setCatTreePath');
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActVendor')->will($this->returnValue($oVendor));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_VENDOR));

$oLocator = new testOxLocator();
Expand Down Expand Up @@ -322,7 +319,6 @@ public function testSetVendorLocatorDataSeo()
$oLocatorTarget->expects($this->any())->method('setCatTreePath');
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActVendor')->will($this->returnValue($oVendor));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_VENDOR));

$oLocator = new testOxLocator();
Expand Down Expand Up @@ -381,7 +377,6 @@ public function testSetManufacturerLocatorData()
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActManufacturer')->will($this->returnValue($oManufacturer));
$oLocatorTarget->expects($this->once())->method('getManufacturerTree')->will($this->returnValue(oxNew('oxmanufacturerlist')));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_MANUFACTURER));

$oLocator = new testOxLocator();
Expand Down Expand Up @@ -419,7 +414,6 @@ public function testSetManufacturerLocatorDataSeo()
$oLocatorTarget->expects($this->any())->method('getCatTreePath');
$oLocatorTarget->expects($this->once())->method('getActManufacturer')->will($this->returnValue($oManufacturer));
$oLocatorTarget->expects($this->once())->method('getManufacturerTree')->will($this->returnValue(oxNew('oxmanufacturerlist')));
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_MANUFACTURER));

$oLocator = new testOxLocator();
Expand Down Expand Up @@ -471,7 +465,6 @@ public function testSetSearchLocatorData()
$oLocatorTarget->expects($this->any())->method('addTplParam');
$oLocatorTarget->expects($this->any())->method('setSearchTitle');
$oLocatorTarget->expects($this->any())->method('getSearchTitle');
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_CATEGORY));

$this->setRequestParameter("searchparam", 'Bier');
Expand Down Expand Up @@ -517,7 +510,6 @@ public function testSetSearchLocatorDataFromVendor()
$oLocatorTarget->expects($this->any())->method('addTplParam');
$oLocatorTarget->expects($this->any())->method('setSearchTitle');
$oLocatorTarget->expects($this->any())->method('getSearchTitle');
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_CATEGORY));

$sSearchVendor = $this->getTestConfig()->getShopEdition() == 'EE'? 'd2e44d9b31fcce448.08890330' : '68342e2955d7401e6.18967838';
Expand Down Expand Up @@ -556,7 +548,6 @@ public function testSetSearchLocatorDataFromCat()
$oLocatorTarget->expects($this->any())->method('addTplParam');
$oLocatorTarget->expects($this->any())->method('setSearchTitle');
$oLocatorTarget->expects($this->any())->method('getSearchTitle');
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_CATEGORY));


Expand Down Expand Up @@ -602,7 +593,6 @@ public function testSetTagLocatorData()
$oLocatorTarget->expects($this->any())->method('addTplParam');
$oLocatorTarget->expects($this->any())->method('setSearchTitle');
$oLocatorTarget->expects($this->any())->method('getSearchTitle');
$oLocatorTarget->expects($this->once())->method('showSorting')->will($this->returnValue(true));
$oLocatorTarget->expects($this->any())->method('getLinkType')->will($this->returnValue(OXARTICLE_LINKTYPE_TAG));

$this->setRequestParameter("searchtag", 'wanduhr');
Expand Down