-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Fixed null deprecation in Mage/Catalog/Model/Product/Option/Type/Text #4357
base: main
Are you sure you want to change the base?
Conversation
kiatng
commented
Nov 15, 2024
•
edited
Loading
edited
Its an issue in core or 3rd-party? |
It happened in custom code to create an order programmatically, I agree that null check for values can be placed here. But I feel the core should be more tolerant because it works before. It's a matter of opinion, I have no issue if others feel otherwise. |
Mhh, instead of adding null-checks everywhere (not only in this PR), why not to override the magic method calls? Add ... ? public function getUserValue(): string
{
return (string) $this->getDataByKey('user_value');
} |
Commit 2 doesn't work: I get Warning: Array to string conversion in .../app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php on line 59 (in my version in production) |
It's not that straight forward! |
you made the change in the wrong file. check https://github.com/kiatng/magento-lts/pull/2/files |
Override magic method