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

Improve sortOrder direction fallback in case of empty string #3399

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

frank-bokdam
Copy link
Contributor

when direction is an empty string, no results will be display in preview due to in error in the call to elastic:

{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:50] [field_sort] failed to parse field [order]"}],"type":"x_content_parse_exception","reason":"[1:50] [field_sort] failed to parse field [order]","caused_by":{"type":"illegal_argument_exception","reason":"No enum constant org.elasticsearch.search.sort.SortOrder."}},"status":400}

when direction is an empty string, no results will be display in preview due to in error in the call to elastic:

```
{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:50] [field_sort] failed to parse field [order]"}],"type":"x_content_parse_exception","reason":"[1:50] [field_sort] failed to parse field [order]","caused_by":{"type":"illegal_argument_exception","reason":"No enum constant org.elasticsearch.search.sort.SortOrder."}},"status":400}
```
@romainruaud
Copy link
Collaborator

Hi @frank-bokdam this is a good guard function, but in which case could this parameter be empty ? and by the way, I thought the getParam() second parameter was intended to be a fallback for such cases ?

Best regards

@romainruaud romainruaud added the safe to test PR can be tested label Oct 22, 2024
@romainruaud romainruaud merged commit 31e6939 into Smile-SA:2.11.x Oct 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test PR can be tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants