-
Notifications
You must be signed in to change notification settings - Fork 152
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
Developer experience: getData should log warnings when an attribute is not loaded #362
Comments
@amenk From my perspecitve in many cases we're just using For now I put there 👎. |
Thanks for your quick feedback - I absolutely get your point. There are lots of cases where you need a certain attribute, but depending on which product instance you have (in an observer for example) and were it was loaded, some attributes might not be available. This is a common source for errors. The attribute is in fact in the database, but just not loaded. What do you think about something like |
Hi @amenk,
Unfortunately it will not be backward compatible change and class is marked with As a workaround in place where you need it (in your customizations) - you could add |
I know there are workarounds to solve this locally, I raise this topic here in architecture to see if it is a good fit for general advancement of the Magento platform. |
Is is a common issue to try to fetch data from objects like products with
$product->getData('attribute')
but depending on the source of those objects (for example if they come from an collection) the attribute is not loaded.I would suggest to at least add a warning
This would improve the developer experience.
The text was updated successfully, but these errors were encountered: