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

TagsConverter creates an empty tag when the input is blank #469

Open
czarnecki opened this issue Jul 6, 2021 · 0 comments · May be fixed by #471
Open

TagsConverter creates an empty tag when the input is blank #469

czarnecki opened this issue Jul 6, 2021 · 0 comments · May be fixed by #471

Comments

@czarnecki
Copy link
Member

czarnecki commented Jul 6, 2021

TagsConverter simply calls String#split(String) which creates an array which only contains the empty string when the input is empty.
That data is then simply passed along further with no validation anywhere.
Because of this that empty string gets saved in the database.
As a work around EditBudgetForm removes the first element of the tags list, if it's not empty.
This means the following steps are necessary to remedy the error:

  • Fix TagsConverter to properly handle empty input
  • Create a migration that removes the invalid data
  • Remove the work around from EditBudgetForm
@czarnecki czarnecki linked a pull request Jul 16, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant