Bug 459370

Summary: Merge tags dont remove old tags
Product: [Applications] digikam Reporter: Petr Schonmann <pschonmann>
Component: Tags-KeywordsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 7.8.0   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 7.9.0
Sentry Crash Report:

Description Petr Schonmann 2022-09-19 07:47:17 UTC
SUMMARY
***
When i merge tag /Party from top level tree into /Events/Party the tag is added, but not removed /Party. Next rescan files load tag into database. Works on multiple tags. No lazy tag writing enabled
***


STEPS TO REPRODUCE
1. Open tags left menu
2. Choose tag which want to merge
3. Drag and drop it into destination tag and confirm you want merge tags
4. Wait for metadata write
5. Refresh folder.
6. Old tags are loaded into DB again

For example merge /Party into /Events/Party
Initial state
|Autumn
|Birthday
|Party
|-Events
   |-Party

After merge
|Autumn
|Birthday
|-Events
   |-Party

After refresh folder is state same as initial. Old tag /Party is not removed from photo, only added /Events/Party
OBSERVED RESULT


EXPECTED RESULT
Working tagging when merge tags. New tags added, old tags removed.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Mint 21
Qt Version: Version 5.15.5 (built against 5.15.5)

Using build from appimage downloaded from homepage digikam
Build date: 8/29/22 4:38 PM (target: RelWithDebInfo)
Revision: c216624f4fb49af301583511b424736c26ac7cbd
Branch: HEAD

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2022-09-19 09:11:02 UTC
I can't reproduce the problem here. What are your metadata settings, do you use sidecars? Extended metadata settings changed?

Maik
Comment 2 Petr Schonmann 2022-09-21 07:29:42 UTC
Hi, i made config by the tutorial that i found on github - https://github.com/roleohibachi/digikam-synology-config ... digikamrc  settings is on https://share.schonmann.eu/buuzq8.txt
Comment 3 Maik Qualmann 2022-09-21 11:14:28 UTC
Thanks for the digiKam configuration file. One of the reasons is that they use xmp.dc.subject as the first metadata entry to get tags. Unfortunately, xmp.dc.subject does not store a tag path, only the keywords. This may be necessary in your case for exchange with other programs. The bug is in the tags cache of digiKam to resolve the tag paths, there was a change here some time ago about a merge request from an external author. Unfortunately he didn't consider this case, I'll fix it.

The problem with these single tags that we get from xmp.dc.subject is that if e.g. "Party" appears several times as a subtag, we don't know which ones to assign it to. So we can only assign it to the first one found in the list.

I would even add it back to the root if "Party" is present several times as a subtag and I can't clearly assign it.

Maik
Comment 4 Maik Qualmann 2022-09-21 17:32:37 UTC
Git commit c46ba2f18b5b74b8bfdf95e378313605881ec404 by Maik Qualmann.
Committed on 21/09/2022 at 17:31.
Pushed by mqualmann into branch 'qt5-maintenance'.

assign a single tag with no path to an existing tag path
FIXED-IN: 7.9.0

M  +2    -1    NEWS
M  +15   -3    core/libs/database/tags/tagscache.cpp

https://invent.kde.org/graphics/digikam/commit/c46ba2f18b5b74b8bfdf95e378313605881ec404
Comment 5 Maik Qualmann 2022-09-21 17:37:02 UTC
But I would make sure that you are looking for a metadata entry that supports tag paths and is also used by the external program and move this to the first position in the advanced metadata settings.

Maik