Bug 376635 - Renaming a tag breaks its member-group
Summary: Renaming a tag breaks its member-group
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: general (show other bugs)
Version: GIT master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-18 20:39 UTC by Johannes Zarl-Zierl
Modified: 2017-02-18 21:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Zarl-Zierl 2017-02-18 20:39:20 UTC
When renaming a tag that is a member of a tag group, the group membership is lost.

You can reproduce this on the demo database using the following steps:

1. Open the annotation dialog
1a. For better clarity of what's happening, switch to tree-mode for the list selects
2. Right-click on "Odense"
3. Choose "Rename..."
4. Enter "Odense-new" and press OK.

Result:
There is a new tag "Odense-new", "Odense" is still displayed as a member of group "Denmark"
When saving the database, the member group "Denmark" is saved with "Odense" as member, or if the compressed file format is used, "Odense" is saved as index "0".

At least using the compressed file format, after restart of kphotoalbum, neither "Odense" nor "Odense-new" is part of the member group "Denmark".
Comment 1 Johannes Zarl-Zierl 2017-02-18 21:42:34 UTC
Git commit f5457379cbd44ea4406a07a3cf1296dc33e7e9bf by Johannes Zarl-Zierl.
Committed on 18/02/2017 at 21:38.
Pushed by johanneszarl into branch 'master'.

Fix renaming and deletion of memberMap members.

The methods renameItem, renameGroup and deleteItem in MemberMap
inadvertingly operated on a copy of the member item set instead of the
real data.

This issue was introduced in commit 8d0b178e8 and is present since
release 4.7.

M  +10   -9    DB/MemberMap.cpp

https://commits.kde.org/kphotoalbum/f5457379cbd44ea4406a07a3cf1296dc33e7e9bf