Skip to content
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

OBPIH-5170 Validate quantity per uom on order item #3660

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

awalkowiak
Copy link
Collaborator

No description provided.

@@ -97,7 +98,7 @@ class ErrorsController {
response.status = 400
BeanPropertyBindingResult errors = request?.exception?.cause?.errors
def errorMessages = errors.allErrors.collect {
return messageService.getMessage(it.codes[0], it.arguments, (it.defaultMessage ?: it.codes[0]), null)
return messageService.getMessage(it.codes[0], it.arguments, (it.defaultMessage ?: it.codes[0]), localizationService.getCurrentLocale())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmiranda Passing null here was causing the NullpointerException in the spring's getMessage(). This is "temporary" fix. I add a topic regarding this to the Monday's TH.

@@ -750,19 +750,21 @@ class OrderController {
orderItem.productSupplier = productSupplier
}

if (!order.save(flush:true)) {
throw new ValidationException("Order is invalid", order.errors)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmiranda I moved this out of the try-catch, to get the advantage of ErrorController's handleValidationErrors (which was missed within the catch)

@awalkowiak awalkowiak merged commit ea09b87 into release/0.8.19-hotfix2 Nov 25, 2022
@awalkowiak awalkowiak deleted the OBPIH-5170 branch November 25, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant