SUMMARY Duplicated tags appear in Tag Editor after I've copied and pasted an event with assigned tag. After that events with duplicated tag don't colored with tag's color in agenda view. Them colored with calendar color STEPS TO REPRODUCE 1. Check only one tag in Tag Manager (ex. "01") 2. Create event 3. Assign tag "01" to the event 4. Copy event with tag and past one in calendar 5. Check Tag Manager. There should be two tags "01" OBSERVED RESULT EXPECTED RESULT Only one tag after copy&paste event SOFTWARE/OS VERSIONS Operating System: Gentoo Linux KDE Plasma Version: 5.22.4 KDE Frameworks Version: 5.85.0 Qt Version: 5.15.2 KDE Grear: 21.08.0 Kernel Version: 5.10.60-gentoo-dist (64-bit) Graphics Platform: X11 Korganizer: 5.18
My tests duplicated a tag, but only a type-2 "GENERIC" tag, and only duplicated it once.
In due rolling down to KO 5.17.3 now I can't test KO 5.18.1 With tag "05-АДМ" it gave up to 5 duplicated tags (dup tag) in Tag Editor The "02-ГРЖ" tag generated one dup tag Perhaps it's depended on locale (used ru_RU)
A possibly relevant merge request was started @ https://invent.kde.org/pim/incidenceeditor/-/merge_requests/22
I use Korganizer...a LOT. This is my main work tool to manage my time. As such, I use Korganizer not once or twice a day, but constantly during my day. In my experience, copy/pasting events (which I do pretty often) does not lead to tag duplication. (I could not tell for tasks, since I almost never copy-paste those) However, if I try to use the tag manager, then tags are created left and right. Same if you use the tag color configuration window. I think copy/pasting is not the problem, the tag manager and tag color configuration window are.
(In reply to Alexandre Bonneau from comment #4) To be clear, pasting an event that has a tag is a reproducible way to create the merge request's precondition, but the actual duplication is the fault of the incidence editor. You can watch the problem in akonadiconsole: 1) Create a new event, give it a new unique tag, and save it. akonadiconsole's Browser tab shows the unique tag; double-click it, and a dialog appears saying that it is a PLAIN tag. On akonadiconsole's DB Browser tab, the pimitemtagrelation table has 1 row relating the new event and tag. 2) Copy the event and paste it. akonadiconsole still shows 1 tag with the unique name, but pimitemtagrelation has 0 rows relating the tag to the pasted event. 3) Edit the pasted event. As soon as the editor opens, akonadiconsole shows 2 tags with the (formerly unique) name; double-click the new one, and a dialog appears saying that it is a GENERIC tag. If there is a sequence of operations that duplicates tags without opening the editor ... that is a different bug.
Git commit 5bf2e967dcd709658a2fae58cfaecb5a04693b2f by Glen Ditchfield, on behalf of Glen Ditchfield. Committed on 30/09/2021 at 01:05. Pushed by gditchfield into branch 'release/21.08'. Do not create duplicate tags If an event with categories is cut & pasted, the pasted event has the same categories as the original but does not have the same tag-item relationships in Akonadi. (This is not the only way that categories and tags go out of sync.) When the incidence editor opens the pasted event, it creates new GENERIC tags for the categories, duplicating the existing tag. Then it inserts the tag in the editor, thus making it dirty and causing unnecessary "Do you really want to cancel?" dialogs. This patch creates PLAIN tags, merges them with existing tags, and does not dirty the editor. M +11 -5 src/incidencecategories.cpp https://invent.kde.org/pim/incidenceeditor/commit/5bf2e967dcd709658a2fae58cfaecb5a04693b2f
Created attachment 142107 [details] KO state after cold start KO state after cold start
Created attachment 142108 [details] Tag Editor state after cold start Tag Editor state after cold start
Created attachment 142109 [details] Tag Editor state after open an event dialog Tag Editor state after open an event dialog
Korganizer is my main planner app. With Manjaro updated up to KO 5.18.1 and kde-frameworks 5.86 the duplication appears on opening any events details dialog. The screenshots demonstrate changing of tag editor state after cold start and opening event dialog
(In reply to gjditchfield from comment #6) > > This patch creates PLAIN tags, merges them with existing tags, and > does not dirty the editor. > > M +11 -5 src/incidencecategories.cpp > > https://invent.kde.org/pim/incidenceeditor/commit/ > 5bf2e967dcd709658a2fae58cfaecb5a04693b2f Today I've updated Akonadi to 20.8.2 and Korganizer to 15.18.2. It looks like all works as expected. Thank you very much.