Bug 437714 - A search group of this or another search is added to existing searches when editing them
Summary: A search group of this or another search is added to existing searches when e...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (show other bugs)
Version: 7.2.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-26 20:35 UTC by Johannes
Modified: 2021-05-28 05:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes 2021-05-26 20:35:58 UTC
SUMMARY
Saved search with "->" in name confuses digiKam: A search group of this or another saved search is added to existing saved searches when editing them

STEPS TO REPRODUCE
1. Create (several) saved searches.
2. Create a saved search with 3 search groups, combined by AND. The XML of my saved search is:
"<?xml version="1.0"?><search><group><field name="tagid" relation="equal">286</field></group><group operator="and"><field name="tagid" relation="equal">84</field></group><group operator="andnot" fieldoperator="or"><field name="keyword" relation="like">Dropbox</field></group></search>
"
3. Name this search: Test -> Saved searches
4. Right click on the saved search -> Edit -> Cancel
5. Open another saved search, Right click -> Edit 


OBSERVED RESULT

The last search group of "Test -> Saved searches" (or sometimes a search group from another saved search) is added at the end. When saving the search, you will  find this confirmed by looking in the database, Table Searches, the XML got changed.

When removing the ">"-character from the name of the saved search, after restarting, the saved searches aren't altered anymore.


EXPECTED RESULT

The naming of saved searches leads to no confusion of digiKam and does not change other saved searches when editing them.


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Ubuntu Linux 18.04.05

KDE Frameworks 5.78.0
Qt 5.14.2 (built against 5.14.2)

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2021-05-27 11:34:46 UTC
The problem has nothing to do with a "->" in the name of saved searches. The problem is that if I edit a search that contains multiple search groups and then edit a search that contains fewer search groups, the existing search groups are not deleted from the dialog. So we have to reset the advanced search dialog before we can edit a search.

Maik
Comment 2 Maik Qualmann 2021-05-28 05:55:56 UTC
Git commit 3b3d4ffcf35c420e2c9bf996074fbf18544e26cb by Maik Qualmann.
Committed on 28/05/2021 at 05:55.
Pushed by mqualmann into branch 'master'.

reset search view when edit a search
FIXED-IN: 7.3.0

M  +2    -1    NEWS
M  +1    -0    core/utilities/searchwindow/searchtabheader.cpp

https://invent.kde.org/graphics/digikam/commit/3b3d4ffcf35c420e2c9bf996074fbf18544e26cb