-
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
Fix for https://github.com/magento/magento2/issues/8287 #8474
Conversation
Added missing __() wrap on execption. Without it a new exception is thrown: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Exception\InputException::__construct() must be an instance of Magento\Framework\Phrase, string given
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.
@ericrisler thank you for your contribution. Your PR fixes the issue but I'd recommend alternative solution.
The issue itself goes from https://github.com/magento/magento2/blob/develop/app/code/Magento/Quote/Model/Quote/Validator/MinimumOrderAmount/ValidationMessage.php#L46
If error message is configured the method returns it as is. I would recommend return Phrase object from the method \Magento\Quote\Model\Quote\Validator\MinimumOrderAmount\ValidationMessage::getMessage() in all cases. In this way, we don't need to wrap method result second time. Plus, the method itself will have strict return type which is better from code design perspective.
СС: @sidolov
@ericrisler thank you for your contribution. We merged your PR with some adjustments |
This doesn't resolve the issue for me. Add one item to cart OK. Second item fails if value is below minimum amount. If value over minimum amount is added to cart, you can add more items, but you cannot delete items if removing them brings the value below minimum. 2.1.6 |
I'm having the same issue as @warperharper. I can add one item just fine. After that, I can't add anything else to my cart or even remove the existing item. My minimum order amount is $60. I added something to my cart that was $2.50. Magento 2.1.6. Please fix this guys. My client needs the minimum order amount |
Still broken on 2.1.6. The change doesn't seem to be merged into the code. |
Still broken in 2.1.8... O_O |
Fix will be available in 2.2 |
@okorshenko Any plans to backport seeing as how this was an issue with 2.1? |
Added missing __() wrap on execption. Without it a new exception is thrown: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Exception\InputException::__construct() must be an instance of Magento\Framework\Phrase, string given
Fix for #8287