-
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
Fixed issue - Minimum Qty Allowed in Shopping Cart functionality breaks product Update Attributes functionality #21643
Conversation
…ks product Update Attributes functionality
Hi @hiren0241. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
This might seem to fix this issue, but what you are doing is retrieving a NULL value (value for |
@samgranger Let me work on your suggestion. |
Hi @hiren0241, thank you for your contribution! |
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.
Hi @hiren0241,
thank you for your contribution!
Unfortunately, we can't accept these changes due to the issues mentioned in code review comments.
Please take into account the recent updates in relevant issue #17592.
There is an already available solution that was reverted due to the backward compatibility issues.
Although, I agree with the recommendation from @samgranger. The most preferable approach would be replacing the existing implementation with the corresponding UI component.
The proper solution I think would be to remove the input field completely and use the ui component that is also used when editing a product, please correct me if I'm wrong!
Thank you!
@@ -168,7 +176,7 @@ public function getConfigFieldValue($field) | |||
*/ | |||
public function getDefaultConfigValue($field) | |||
{ | |||
return $this->stockConfiguration->getDefaultConfigValue($field); | |||
return $this->json->unserialize($this->stockConfiguration->getDefaultConfigValue($field)); |
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.
The getDefaultConfigValue
method is not expected to be used for serialized values only.
I guess we need to make sure that we unserialize only serialized values etc.
@@ -75,6 +82,7 @@ public function __construct( | |||
$this->coreRegistry = $coreRegistry; | |||
$this->stockRegistry = $stockRegistry; | |||
$this->stockConfiguration = $stockConfiguration; | |||
$this->json = $json; |
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.
The new constructor parameters should be optional in order to avoid backward compatibility issues.
Please check the Contribution Guide (section Adding a constructor parameter) for more details.
@dmytro-ch Hi, |
@hiren0241 you may check the solution proposed in #19095. |
@hiren0241 , I am closing this PR now due to inactivity. |
Hi @hiren0241, thank you for your contribution! |
Description (*)
Resolve issue of Minimum Qty Allowed in Shopping Cart" functionality breaks product "Update Attributes" functionality
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)