Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Model/Product/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ public function getUrl(\Magento\Catalog\Model\Product $product, $params = [])
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);

if ($categoryId) {
if ($useCategories && $categoryId) {
$filterData[UrlRewrite::METADATA]['category_id'] = $categoryId;
} elseif (!$useCategories) {
} else {
$filterData[UrlRewrite::METADATA]['category_id'] = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rewrite as ternary operator instead.

QA Note: f47347f issue needs to be rechecked

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewbess also, please implement an integration test for corresponding scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orlangur Ok. Thank you.

}

Expand Down