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

[6.0] Don't add soft delete query filter on hard delete models #321

Merged
merged 3 commits into from
Nov 19, 2018

Conversation

jhoff
Copy link

@jhoff jhoff commented Nov 18, 2018

Currently, when the static search method from the Searchable trait is called, a new scout query builder is instantiated and the $softDelete flag is based only on config('scout.soft_delete').

The builder should only apply soft deletes if the model that is being searched also uses them.

It seems that Algolia ignores the additional __soft_delete filter when it it passed in a search that doesn't use soft deletes, but other drivers have to go out of the way to fix this deficiency ( See this section in the tnt search driver as an example )

This pull request fixes the searchable trait to only apply the soft delete filter when the model being searched actually uses soft deletes.

Copy link
Member

@nunomaduro nunomaduro left a comment

Choose a reason for hiding this comment

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

For me, everything seems fine in this Pull Request.

@driesvints driesvints changed the title Don't add soft delete query filter on hard delete models [6.0] Don't add soft delete query filter on hard delete models Nov 19, 2018
@taylorotwell taylorotwell merged commit 47e6135 into laravel:6.0 Nov 19, 2018
@jhoff
Copy link
Author

jhoff commented Nov 19, 2018

@taylorotwell thanks for the merge. Is there a process to tagging / releasing new code changes?

@driesvints
Copy link
Member

@jhoff tagged 6.1.0

@jhoff
Copy link
Author

jhoff commented Nov 19, 2018

@driesvints Thank you sir!

@06chaynes
Copy link

06chaynes commented Dec 19, 2018

I had already submitted a new issue ( #338 ) on this before I saw this thread, but I am having this exact issue on v6.1.3

The trait is being applied still, regardless of the config setting.

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.

5 participants