traggo / server

self-hosted tag-based time tracking
https://traggo.net
GNU General Public License v3.0
1.09k stars 55 forks source link

[Bug report] renaming a tag #131

Open black-fake opened 1 year ago

black-fake commented 1 year ago

Description:

When renaming a tag which is already in use to a name containing capital letters the name of the tag is transformed to lowercase and applied to the tag. But the already assigned events will be tagged with the original version of the new tag name. So there are 2 tags with the same name --> the mapping between the tag and the Event is somehow lost.

Example:

tag name before renaming: "this_is_a_test" I want to rename tag to: "This_is_a_NEW_test"

=> in the tag overview there is the tag: "this_is_a_new_test" the assigned events now have the following tag: "This_is_a_NEW_test"

==> the tag in the overview "thinks" it has never been used because it doesn't match, but the one with capital letters is not shown because there already is the same tag (just with only lowercase letters)

Steps to reproduce the behavior:

  1. create a tag
  2. create some event(s) with this tag
  3. go to: Sidebar -> Tags
  4. you see the amount of usages ( > 0 )
  5. rename the tag to something containing capital letters
  6. the usage amount dropped to 0
  7. the tag has been renamed to an all-lowercase-name
  8. go to: List or Calendar
  9. see the tag name with capital letters
jmattheis commented 1 year ago

Tags are normally always lowercase, it seems that the rename tag feature doesn't lower case the tag before updating the database.