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

Return an error when autocompleting taxons without a vocabulary #6114

Conversation

jrdh
Copy link
Member

@jrdh jrdh commented Jan 22, 2020

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:

image

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:

  1. Return an empty array as we know that nothing should match the query.
  2. Miss out the in clause and search all taxonomies.
  3. Return an error.

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!

Copy link
Contributor

@PaulKiddle PaulKiddle left a comment

Choose a reason for hiding this comment

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

I can't reproduce the original bug but the code changes look fine to me

@Archilegt
Copy link

Is this related to taxon names now not filled in for edition? When manually editing a classification, the name to be edited is not appearing by default, which causes the user having to type it or copy it completely, even if the edit was just a minor edit like a one-letter misspelling. When the taxon in question is a quadrinomial, the burden quadruplicates. I would recommend to change the current behavior of the taxon editor for having the name pre-filled in the unit name fields.

@PaulKiddle
Copy link
Contributor

@Archilegt This sounds like an unrelated bug, could you please open a new issues for this? If possible with a screenshot. Thanks.

@PaulKiddle PaulKiddle merged commit c43e45a into master Jan 27, 2020
@PaulKiddle PaulKiddle deleted the josh/control_error_when_no_vocabs_are_associated_with_taxon_field branch January 27, 2020 12:04
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.

Taxonomy autocomplete sometimes doesn't work when adding interactions
3 participants