RE: OrderValidator and CustomOrderValidator error

thumbnail
Gennaro Lippiello, modified 3 Years ago. Junior Member Posts: 39 Join Date: 3/9/22 Recent Posts

Good morning to everyone. I'm following this example https://learn.liferay.com/commerce/latest/en/developer-guide/sales/implementing-a-custom-order-validator.html in order to implement a custom order validator. I noticed that when a new CommerceOrderValidatorResult(TRUE) is returned everything works good, but when a new CommerceOrderValidatorResult(FALSE) is returned then the custom error message doesn't show up and I get this ERROR
[http-nio-8080-exec-9][ExceptionMapper:68] null
com.liferay.commerce.exception.CommerceOrderValidatorException: null.
at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.validate(CommerceOrderItemLocalServiceImpl.java:1164) ~[?:?]
at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl._createCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:1194) ~[?:?]
at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.addCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:134) ~[?:?]
....
....

 

This error happens also with the default CommerceOrderValidator, for example on a fresh installation when you try to add to cart a product and you don't have enough quantity.

Liferay Community Edition Portal 7.4.3.18 

thumbnail
Gennaro Lippiello, modified 3 Years ago. Junior Member Posts: 39 Join Date: 3/9/22 Recent Posts

Actually it came up that was a bug!

After my post an issue has been opened (https://issues.liferay.com/browse/COMMERCE-9060). So I guess the problem will be fixed in next release.