Bug 501616

Summary: Drag and drop same folder into subfolder creates recursive copy
Product: [Applications] digikam Reporter: grazier
Component: Usability-Drag&DropAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 8.6.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.7.0
Sentry Crash Report:

Description grazier 2025-03-17 03:15:46 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
Attempting to move the same album to the same target album before the original move completes ends up creating recursive sub albums of the moved folder under the target album.


STEPS TO REPRODUCE
1. Drag large album to a sub album at the same level
2. While that album is moving (before it disappears from original location), drag the same album to the same sub album.  It will mention that the album already exists in that album.  In this case do not select rename (note: rename will do a different version of this where it creates a newly named folder and then does the same recursion).
3. 

OBSERVED RESULT
Wait a minute and you will see the same album being copied into that sub-album recursively.... 
it will look like root/sa/ma/ma/ma/ma/ma/... 
where sa is the sub-album you are attempting to move and ma is the 'moving album' that you've dragged into the sub-album multiple times.

If you do not catch it quick enough it creates a deep enough nesting that windows fails when trying to delete it.  I can move it out of the digikam structure to a junk location so it doesn't affect my backup or digikam software which will try to traverse it when scanning and depending on how deep, fail itself.


EXPECTED RESULT
That it will recognize that it's already moving the album from its original location and refuse the attempt to move it again from that original location.


SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 grazier 2025-03-17 03:16:42 UTC
This has occurred in 8.5 and another previous version prior to 8.x.  This third time I decided to report the bug.
Comment 2 Maik Qualmann 2025-03-17 06:54:47 UTC
Drag & Drop into a subfolder isn't possible under Linux, at least not here, because a prohibition icon appears as the drag symbol. I'll test this later on Windows as well.

Maik
Comment 3 grazier 2025-03-17 23:39:39 UTC
I wanted to add that this also happened under windows 10.
Comment 4 Maik Qualmann 2025-03-18 07:05:18 UTC
Git commit e71928cd76b5bf1d65d119bfd19a93190b9ba940 by Maik Qualmann.
Committed on 18/03/2025 at 07:04.
Pushed by mqualmann into branch 'master'.

check paths currently in use during file operations
A warning message box will then be displayed.
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +54   -8    core/libs/database/utils/ifaces/dio.cpp
M  +5    -3    core/libs/database/utils/ifaces/dio.h

https://invent.kde.org/graphics/digikam/-/commit/e71928cd76b5bf1d65d119bfd19a93190b9ba940