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

Error with ?? in Typesense.php #7

Closed
manavo opened this issue Aug 11, 2021 · 1 comment · Fixed by #8
Closed

Error with ?? in Typesense.php #7

manavo opened this issue Aug 11, 2021 · 1 comment · Fixed by #8

Comments

@manavo
Copy link
Contributor

manavo commented Aug 11, 2021

Description

Because of how the ?? check works, it will never actually try and load the document/collection in these places:

https://github.com/typesense/laravel-scout-typesense-driver/blob/master/src/Typesense.php#L89
https://github.com/typesense/laravel-scout-typesense-driver/blob/master/src/Typesense.php#L118
https://github.com/typesense/laravel-scout-typesense-driver/blob/master/src/Typesense.php#L163

The typesense library will always return the object, so the check for existence and then the null fallback are pointless, and actually breaks it.

I'll submit a PR for this tomorrow, unless someone beats me to it (@hi019?)

@manavo
Copy link
Contributor Author

manavo commented Aug 11, 2021

It was introduced in the last commit on the old repo by @AbdullahFaqeir: devloopsnet/laravel-scout-typesense-engine@55efffa, but won't work in this case and needs to be removed.

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 a pull request may close this issue.

1 participant