Skip to content

Commit 3416f46

Browse files
committed
MAGETWO-90940: SEO-friendly URL for category page not working
1 parent b7b6754 commit 3416f46

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Magento\Framework\Controller\Result\Json;
2020
use Magento\Backend\Model\Auth\Session;
2121
use Magento\Framework\DataObject;
22-
use Zend_Filter_Input;
2322

2423
/**
2524
* Catalog category controller
@@ -42,10 +41,8 @@ abstract class Category extends Action
4241
* @param Context $context
4342
* @param Date|null $dateFilter
4443
*/
45-
public function __construct(
46-
Context $context,
47-
Date $dateFilter = null
48-
) {
44+
public function __construct(Context $context, Date $dateFilter = null)
45+
{
4946
$this->dateFilter = $dateFilter;
5047
parent::__construct($context);
5148
}
@@ -117,7 +114,7 @@ private function resolveStoreId(): int
117114
return $storeId ?: (int)$this->getRequest()->getParam('store_id', Store::DEFAULT_STORE_ID);
118115
}
119116

120-
/**Zend_Filter_Input
117+
/**
121118
* Build response for ajax request
122119
*
123120
* @param CategoryModel $category
@@ -127,10 +124,8 @@ private function resolveStoreId(): int
127124
*
128125
* @deprecated 101.0.0
129126
*/
130-
protected function ajaxRequestResponse(
131-
CategoryModel $category,
132-
Page $resultPage
133-
): Json {
127+
protected function ajaxRequestResponse(CategoryModel $category, Page $resultPage): Json
128+
{
134129
// prepare breadcrumbs of selected category, if any
135130
$breadcrumbsPath = $category->getPath();
136131
if (empty($breadcrumbsPath)) {
@@ -167,6 +162,7 @@ protected function ajaxRequestResponse(
167162
$resultJson = $this->_objectManager->get(Json::class);
168163
$resultJson->setHeader('Content-type', 'application/json', true);
169164
$resultJson->setData($eventResponse->getData());
165+
170166
return $resultJson;
171167
}
172168

@@ -189,7 +185,7 @@ protected function dateTimePreprocessing(CategoryModel $category, array $postDat
189185
}
190186
}
191187
}
192-
$inputFilter = new Zend_Filter_Input($dateFieldFilters, [], $postData);
188+
$inputFilter = new \Zend_Filter_Input($dateFieldFilters, [], $postData);
193189
return $inputFilter->getUnescaped();
194190
}
195191
}

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminUpdateCategoryStoreUrlKeyTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<group value="category"/>
2020
</annotations>
2121
<before>
22-
<!-- Create category, change store view to default -->
22+
<!-- Create category -->
2323
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2424
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/>
2525
<waitForPageLoad stepKey="waitForPageLoad1"/>
@@ -57,7 +57,7 @@
5757
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="assertCategoryOnStorefront"/>
5858
<seeInTitle userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNameInTitle"/>
5959
<seeInCurrentUrl stepKey="verifyUrlKey" url="{{_defaultCategory.name_lwr}}-hattest.html"/>
60-
<!-- Update SEO key to original, uncheck "Create Redirect", confirm in frontend, delete category -->
60+
<!-- Update SEO key to original, uncheck "Create Redirect", confirm in frontend -->
6161
<!--Switch to "Default Store View" scope-->
6262
<actionGroup ref="switchCategoryStoreView" stepKey="SwitchStoreView2">
6363
<argument name="store" value="_defaultStore.name"/>

0 commit comments

Comments
 (0)