-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#16273: Fix bug in method getUrlInStore() of product model #16468
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
product
model 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:
.phtml
file, 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