Skip to content

Commit 52fabb9

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-93425: Permanent Redirect for old URL missing via API or no documentation
1 parent cb466f1 commit 52fabb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver
4747
$requestBodyParams = $this->request->getBodyParams();
4848

4949
if ($this->isProductSaveCalled($serviceClassName, $serviceMethodName)
50-
&& $this->isCustomOptionExists($requestBodyParams)) {
50+
&& $this->isCustomAttributesExists($requestBodyParams)) {
5151
foreach ($requestBodyParams['product']['custom_attributes'] as $attribute) {
5252
if ($attribute['attribute_code'] === 'save_rewrites_history') {
5353
foreach ($result as $resultItem) {
@@ -56,6 +56,7 @@ public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver
5656
break 2;
5757
}
5858
}
59+
break;
5960
}
6061
}
6162
}
@@ -80,7 +81,7 @@ private function isProductSaveCalled(string $serviceClassName, string $serviceMe
8081
* @param array $requestBodyParams
8182
* @return bool
8283
*/
83-
private function isCustomOptionExists(array $requestBodyParams): bool
84+
private function isCustomAttributesExists(array $requestBodyParams): bool
8485
{
8586
return !empty($requestBodyParams['product']['custom_attributes']);
8687
}

0 commit comments

Comments
 (0)