Return an error when autocompleting taxons without a vocabulary #6114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #5866
Firstly, just for completeness, the reason this was breaking was because we were attempting to run an empty
in
clause. The difference between the two queries is that the second has values in it's in clause:What those values are and where they come from I'm not sure of though, I'm also not sure why both autocomplete paths were being used at different times on the same page.
Either way, the fundamental issue is in the
scratchpads_taxonomic_name_field_autocomplete
function. So what do we do if there aren't any vocabularies set on the field? There are 3 choices as far as I can see:in
clause and search all taxonomies.I chose to go with the 3rd choice but I'm happy to debate this. I definitely don't think we should do option 2, but option 1 is a possibility.
Input from @alycejenni, @PaulKiddle and @benscott welcome!