-
-
Notifications
You must be signed in to change notification settings - Fork 858
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: encode search keyword #2903
base: master
Are you sure you want to change the base?
Conversation
Note: need to review as encoding the keyword is a change in behavior and might cause a breaking change. |
Co-authored-by: Mathieu FERRE <[email protected]>
This reverts commit 077d2e8.
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
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.
This change will make we can not search non encoded special chars. an example we have data "Hand & Soulder"(no encode) and we search using "&", and the data will not shown.
My suggestion is using attribute like searchable in datatable options.
an example:
{data: 'name', name: 'name',searchable: true, is_encoded:true},
and if is_encoded:true
, we use e()
function, otherwise return without encode.
@dyaskur thanks for the review. However, adding How about if we add another control on a column level that toggles encoded search? Maybe something like: ->encodedSearch(['col1', 'col2']) |
I see, I thought datatable will send all column attribute to the ajax request. If can't send by client side, we need to set it on server side. And I think your idea looks good. |
@yajra , recently came up with a similar solution while debugging a weird behavior with the |
@aravael, would you be able to test this and see the impact on your existing project? Would you approve this PR? |
Hi @yajra . Recently managed to test it, can't approve this patch. Though it fixes the collection search, it breaks the It works with a collection because both the |
Fix #2901