diff --git a/source/Application/Component/Locator.php b/source/Application/Component/Locator.php index 25014d8564..3b9d37dd2b 100644 --- a/source/Application/Component/Locator.php +++ b/source/Application/Component/Locator.php @@ -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); @@ -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 @@ -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 @@ -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 diff --git a/tests/Unit/Application/Controller/LocatorTest.php b/tests/Unit/Application/Controller/LocatorTest.php index a175b8a85d..84d390ee69 100644 --- a/tests/Unit/Application/Controller/LocatorTest.php +++ b/tests/Unit/Application/Controller/LocatorTest.php @@ -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(); @@ -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')); @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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'); @@ -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'; @@ -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)); @@ -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');