Bug 445043 - Attempting to rename a tag to the same name causes the tag to be deleted
Summary: Attempting to rename a tag to the same name causes the tag to be deleted
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tagging (other bugs)
Version First Reported In: 5.0.0-beta2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2021-11-05 21:46 UTC by Eoin O'Neill
Modified: 2021-11-11 04:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eoin O'Neill 2021-11-05 21:46:03 UTC
SUMMARY
I was testing the tag rename system as part of testing day and noticed that renaming the tag to the same name will cause an overwrite warning about deleting the old tag. In this circumstance, the tag will be deleted and no tag will exist anymore. 

STEPS TO REPRODUCE
1. Go to brush preset docker and select a tag. In my example, "Paint".
2. Click on the "Tag" button to get the rename prompt. 
3. In the rename field, type in the same name as the current tag. E.G. "Paint".
4. Overwrite prompt occurs, choose to replace the tag. 

OBSERVED RESULT
The tag ("Paint") will no longer exist in the listing. Adding it back again will not restore it.

EXPECTED RESULT
The tag should maintain the same name, exist as it used to, and should probably not even bother warning the user about overwriting a tag. 

SOFTWARE VERSIONS
Krita/5.0 HEAD
Comment 1 Eoin O'Neill 2021-11-11 04:17:06 UTC
Git commit 19340fcd2e7cb0f1df4d66a02036d0a7107c897b by Eoin O'Neill.
Committed on 11/11/2021 at 04:16.
Pushed by eoinoneill into branch 'master'.

Prevent deletion of tag when renaming to same name.

We should just skip renaming the tag in the off chance
that someone types in the same name as the currently
selected tag.

M  +1    -1    libs/resourcewidgets/KisTagChooserWidget.cpp

https://invent.kde.org/graphics/krita/commit/19340fcd2e7cb0f1df4d66a02036d0a7107c897b
Comment 2 Eoin O'Neill 2021-11-11 04:18:09 UTC
Git commit a034950bb400da73ced6135cf85bbe2f13cdd413 by Eoin O'Neill.
Committed on 11/11/2021 at 04:17.
Pushed by eoinoneill into branch 'krita/5.0'.

Prevent deletion of tag when renaming to same name.

We should just skip renaming the tag in the off chance
that someone types in the same name as the currently
selected tag.
(cherry picked from commit 19340fcd2e7cb0f1df4d66a02036d0a7107c897b)

M  +1    -1    libs/resourcewidgets/KisTagChooserWidget.cpp

https://invent.kde.org/graphics/krita/commit/a034950bb400da73ced6135cf85bbe2f13cdd413