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

Restrict terms list param type #2118

Merged
merged 2 commits into from Sep 5, 2022
Merged

Restrict terms list param type #2118

merged 2 commits into from Sep 5, 2022

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Sep 2, 2022

I'm getting

[1:51] [terms_lookup] unknown field [0] [reason: [1:55] [bool] failed to parse field [must]]

error when I passed something like

[0 => 3, 2 => 4]

to the Query\Terms.

As soon as I use array_values on the array I passed, the error is getting away.

I see two solutions for this:

  • Restrict the phpdoc to list<bool|float|int|string>
  • Calling array_values inside the setTerms` method.

What do you prefer ? @ruflin

@ruflin
Copy link
Owner

ruflin commented Sep 5, 2022

I like the phpdocs change as it seems mainly we got the docs wrong. Adding array_values would mainly expand the magic the function does and I'm normally not a big fan. Lets have just one mode of adding the data.

@VincentLanglet Thanks for the update, any chance you could also add a note to the changelog file?

@VincentLanglet
Copy link
Contributor Author

@VincentLanglet Thanks for the update, any chance you could also add a note to the changelog file?

done

@ruflin ruflin merged commit c1a49d5 into ruflin:master Sep 5, 2022
@ruflin
Copy link
Owner

ruflin commented Sep 5, 2022

Thanks!

@VincentLanglet VincentLanglet deleted the patch-1 branch September 5, 2022 07:59
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.

None yet

2 participants