-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Inconsistent return type for getStoreId() #18079
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
Comments
Hi @sreichel. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @sreichel do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets |
Hi @sreichel , thank you for your report. |
Summary
getStoreId()
returns astring
for products, butint
for categories that causes a fatal error in extensions code.Examples
Simplified code:
ObserverA:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Model/Product.php#L521-L532
ObserverB:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Model/Category.php#L560-L573
Shared method
If i pass products store ID to
someMethod
i get a fatal error.Proposed solution
int
in product modelgetStoreId()
methods to return always int valueWould create PR for "1." since I#ve not enough time to check all others.
Please advice.
The text was updated successfully, but these errors were encountered: