#16273: Fix bug in method getUrlInStore() of product model#16468
Conversation
# Method $product->getUrlInStore() returning extremely long URLs, could be a bug (cherry picked from commit 7558ac0)
…store-wrong-link_mage22' into magento#16273-product-geturlinstore-wrong-link_mage22
|
Hi @vasilii-b. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
| $storeCode = $subject->getScope() ?: $this->storeManager->getStore()->getCode(); | ||
| /** @var Store $currentScope */ | ||
| $currentScope = $subject->getScope(); | ||
| $storeCode = $currentScope && $currentScope instanceof Store ? |
There was a problem hiding this comment.
Would it make sense to check for StoreInterface in this case?
|
@vasilii-b : correct me if I'm wrong, but the setting not: Although it's indeed incorrect that it adds that suffix to the url, but it is probably unrelated to the setting UPDATE: nevermind me, I think I understand what's happening, please ignore this post ;) |
https://github.com/vasilii-b/magento2 into magento#16273-product-geturlinstore-wrong-link_mage22
|
@ishakhsuvarov , can you please have a look on this one ? Requested changes were added. |
|
Hi @vasilii-b. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Description
This PR reference changes how/what is returned when
productmodel methodgetUrlInStore()is called$product->getUrlInStore().Problem is in how the current store is checked and what is returned based on it.
Fixed Issues
Manual testing scenarios
For issue 1 - please see the issue description.
For issue 2:
.phtmlfile, list.phtml for example, call methodgetUrlInStore()for a product.Expected Result
Store code is not added into product url
Actual Result
Store code is added into product url
Contribution checklist