-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
!!![FEATURE] Allow using complex filter values in FlexForm #3703
Conversation
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 code base LGTM!
Please add
- the hints from your issue comment FlexForm filter values are force quoted #2151 (comment)
to the docs, so users are aware of. - and a little sentence in Documentation/Releases/solr-release-12-0.rst about this feature.
@echavaillaz For CS fixes just run this command: The unit test and/or method
|
Ready to test? |
With this change it is now possible to use complex query in FlexForm filter value. The old behaviour is still working, so if a string value contains space(s) and no special characters of the solr query parser, the string is always wrapped with double quotes. But if the string contains special characters no wrapping happen special characters are: `+ - && || ! ( ) { } [ ] ^ " ~ * ? : \`. There is some cases where this change can break, for example if the filter value is something like `toto AND tata` or `music (rock)` or `my "flow" is`. Here the wrapping and the escaping of the inner double quote have to be manually updated like this `"toto AND tata"` or `"music (rock)"` and `"my \"flow\" is"`. Fixes: TYPO3-Solr#2151
With this PR it is now possible to use complex query in FlexForm filter value.
I add a regex to prevent a too big breaking change. The old behaviour is still working, so if a string value contains space(s) and no special characters of the solr query parser, the string is always wrapped with double quotes. But if the string contains special characters no wrapping happen (special characters are
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
.There is some cases where this PR can break, for example if the filter value is something like
toto AND tata
ormusic (rock)
ormy "flow" is
. Here the wrapping and the escaping of the inner double quote have to be manually updated like this"toto AND tata"
,"music (rock)"
and"my \"flow\" is"
.Fixes: #2151