Issue-4769 - Unable to update case of label
Created by: dblessing
Labels are saved in the database with the case they were originally created with. Before this change if a user created a label with the same text but different case the label would use the original case and no new label would be created in the database. With this change, labels are now case-sensitive.
Steps to test:
- Before this change, create a new issue with a new label "FIxMe"
- Edit the issue and change the label to "FixMe"
- Note that the label reverted to "FIxMe"
- Apply this change
- Edit the issue again and change the label to "FixMe"
- Note that the new case was preserved. If you also look in the database in the "tags" table you will see that both labels are present - "FIxMe" and "FixMe".
Created by: dblessing
I should add that I came upon this solution based on the README for the acts-as-taggable-on project at https://github.com/mbleigh/acts-as-taggable-on/blob/master/README.md
By Administrator on 2013-08-16T14:58:52 (imported from GitLab project)
Created by: coveralls
Coverage decreased (-0%) when pulling bd7dbaf330bea9dbbafb14f474c698040e61527e on bke-drewb:issue-4769 into 0e387919 on gitlabhq:master.
By Administrator on 2013-08-16T15:24:43 (imported from GitLab project)
Created by: dblessing
@randx Really it's a matter of fixing typos, for readability and usability. I worked on this after talking with a person who had messed up a label and then couldn't fix it. So if you create a label such as "mYmEssEdUplAbel" then you have no way to create a correct label like "MyMessedUpLabel". I think it's either this solution, allow editing, or downcase all labels before storing. But then I'd say, why not case-sensitive?
By Administrator on 2013-09-30T13:59:02 (imported from GitLab project)
Created by: dzaporozhets
@bke-drewb your current fix applies only on project labels. See https://github.com/gitlabhq/gitlabhq/blob/master/app/models/issue.rb#L36
By Administrator on 2013-10-01T11:58:00 (imported from GitLab project)
Created by: alison-gravley
Thanks for continuing to work on this. We use a lot of camel case for readability and having them all lower case would drive project leads crazier than they already are. Hope to see this in 6.2. Thanks again!
By Administrator on 2013-10-18T11:48:47 (imported from GitLab project)