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

Fix PHP warning #407

Merged
merged 1 commit into from
Jun 15, 2018
Merged

Conversation

vdechenaux
Copy link

This PR fixes E_WARNING: Invalid argument supplied for foreach() here : https://github.com/algolia/algoliasearch-client-php/blob/master/src/AlgoliaSearch/Index.php#L850

In some cases I don't have the facets key :

image

@julienbourdeau
Copy link

Nice catch! 💯
I'm surprised this wasn't fixed before. Can you give me more details on how you got this error?

@vdechenaux
Copy link
Author

The index has no records and no "Attributes for faceting" and I call client->initIndex($index)->searchDisjunctiveFaceting($query, $disjunctiveFacets, $params, $refinements) with:
image

@vdechenaux
Copy link
Author

This error is flooding my production logs, UP please

@julienbourdeau julienbourdeau merged commit 5cafdc5 into algolia:master Jun 15, 2018
@vdechenaux vdechenaux deleted the fix-php-warning branch June 15, 2018 11:44
@vdechenaux
Copy link
Author

Thanks!

@julienbourdeau
Copy link

You're welcome! I just released 1.26.1 with this fix 👍

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.

2 participants