-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 backend search #775
Fix backend search #775
Conversation
Backend search doesn't work properly if exists a previous where sentence of `deleted_at`. The problem is on the use of `orWhere`, without validate for previous wheres, making a final SQL like this `table_name`.`deleted_at` is null or (((lower(table_name.column_one) LIKE '%term%') I don't know if my solution is the correct one. Thanks
Can you please add more detail?
|
SummaryHaving a Model with
In this case, the method for the In my fixed code, I try to read the last where sentence and find the "deleted_at" column name, if exists, use Request location
Expected resultWhen the model has softdelete, and the list are separated by active elements and deleted elements (trash). The search must be return the items, corresponding the term of search and the model columns. Actual resultUsing the list search, in the backend, if the model has softdelete, the search returns all the items. Sorry my English. I try to be clear on the explication. |
Hi, any update on this? List search really doesn't work along with SoftDeletingTrait/SoftDeletes.. |
This is a dirty fix for a problem I cannot see demonstrated. I have created a list using a model with soft deletes, the list can be searched successfully. |
Refs #775 to support soft deletes
I was later able to replicate this, it has now been fixed in 8d93c9f |
I try this change before, and fail on common queries (without softDelete). I know my solution was dirty, but this simple solution not work on all possible environments. |
Can you provide an example of a common query where it fails? |
Let me make some tests on the Beta version. I still using the Laravel 4.2 version. |
Ok, that's fine, please submit as a new Issue if you discover any problems. |
I noticed there was a problem here when searching related columns, I managed to resolve it in 93dd61e |
Great, I will testing soon, actually have no time :( |
Backend search doesn't work properly if exists a previous where sentence of
deleted_at
.The problem is on the use of
orWhere
, without validate for previous wheres, making a final SQL like thisI don't know if my solution is the correct one. It work fine on my tests.
Thanks