https://bugs.kde.org/show_bug.cgi?id=432761

David Haslam <dch.c...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dch.c...@gmail.com

--- Comment #8 from David Haslam <dch.c...@gmail.com> ---
I came across a similar problem, while working with a large tag
hierarchy where the same word is used at different levels.

I've been able to reproduce the problem with a clean database and
doing these steps:

1. Use the tag manager to create these tags:
   - "2020/11 Bob"
   - "2020/2020/11 Bob"

   See image tag-hierarchy-1.jpg

2. Create a blank test image, with no metadata. Refresh to view the new image
in digikam.

3. Select the image and assign "2020" and "2020/11 Bob" to the test image.

   See attachment tag-hierarchy-2.jpg

4. Click Apply to write the metadata (I have digikam configured to write to XMP
sidecars).

   The XMP file contains:

   <digiKam:TagsList>
    <rdf:Seq>
     <rdf:li>2020</rdf:li>
     <rdf:li>2020/11 Bob</rdf:li>
    </rdf:Seq>
   </digiKam:TagsList>

   Which looks correct.

5. Click "More"->"Read Metadata from file to database".

6. Observe that "2020/2020" and "2020/2020/Bob" are now erroneously ticked.
   See attachment tag-hierarchy-3.jpg

The fault lies in TagsCache::tagForPath in file
core/libs/database/tags/tagscache.cpp.

This function doesn't properly handle the case of a path with only one level,
and multiple tag paths with the same name.

I've been testing a fix, and a pull request will be sent shortly.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to