Bug 427348 - Some user profile fields won't apply unless they all have unique new values
Summary: Some user profile fields won't apply unless they all have unique new values
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_users (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-04 22:12 UTC by Alexander Potashev
Modified: 2020-10-25 18:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2020-10-04 22:12:27 UTC
SUMMARY
Some user profile fields won't apply unless they all have unique new values.

STEPS TO REPRODUCE
1. Start the Users KCM ("kcmshell5 kcm_users")
2. Select a user
3. Change the full name (the top-most input field) to "foo", change the email address to "foo@example.com", click Apply.
4. Restart the Users KCM and make sure the change applied.
5. Change the full name to "bar@example.com", change the email address to "bar@example.com" as well, click Apply.

OBSERVED RESULT
The full name remains "foo", the email address is changed to "bar@example.com".

EXPECTED RESULT
Both fields should change to "bar@example.com".

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Built from Git master at f7a5514f22465fe02759417333806b59e1238eb6.

Root cause: When the std::map used in UserApplyJob::start() is initialized, the key-value {"bar@example.com", full name setter ptr} is being overwritten by key-value {"bar@example.com", email setter ptr}.

Proposed fix: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/172
Comment 1 Nate Graham 2020-10-25 18:13:27 UTC
Git commit 5cdff9625bf35239f7337911bd1de047bce2546a by Nate Graham, on behalf of Alexander Potashev.
Committed on 25/10/2020 at 18:13.
Pushed by ngraham into branch 'master'.

Fix bug: Some user profile fields won't apply unless they all have unique new values.

Fixes the following bug: Some user profile fields won't apply unless
they all have unique new values.

STEPS TO REPRODUCE
1. Start the Users KCM ("kcmshell5 kcm_users")
2. Select a user
3. Change the full name (the top-most input field) to "foo", change the
   email address to "foo@example.com", click Apply.
4. Restart the Users KCM and make sure the change applied.
5. Change the full name to "bar@example.com", change the email address
   to "bar@example.com" as well, click Apply.

OBSERVED RESULT: The full name remains "foo", the email address is
changed to "bar@example.com".

EXPECTED RESULT: Both fields should change to "bar@example.com".

Root cause: When the std::map used in UserApplyJob::start() is
initialized, the key-value {"bar@example.com", full name setter ptr} is
being overwritten by key-value {"bar@example.com", email setter ptr}.

M  +1    -1    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/5cdff9625bf35239f7337911bd1de047bce2546a
Comment 2 Nate Graham 2020-10-25 18:13:46 UTC
Git commit 3308dee942d1982a0aba68fc41368a284afc8e21 by Nate Graham, on behalf of Alexander Potashev.
Committed on 25/10/2020 at 18:13.
Pushed by ngraham into branch 'Plasma/5.20'.

Fix bug: Some user profile fields won't apply unless they all have unique new values.

Fixes the following bug: Some user profile fields won't apply unless
they all have unique new values.

STEPS TO REPRODUCE
1. Start the Users KCM ("kcmshell5 kcm_users")
2. Select a user
3. Change the full name (the top-most input field) to "foo", change the
   email address to "foo@example.com", click Apply.
4. Restart the Users KCM and make sure the change applied.
5. Change the full name to "bar@example.com", change the email address
   to "bar@example.com" as well, click Apply.

OBSERVED RESULT: The full name remains "foo", the email address is
changed to "bar@example.com".

EXPECTED RESULT: Both fields should change to "bar@example.com".

Root cause: When the std::map used in UserApplyJob::start() is
initialized, the key-value {"bar@example.com", full name setter ptr} is
being overwritten by key-value {"bar@example.com", email setter ptr}.


(cherry picked from commit 5cdff9625bf35239f7337911bd1de047bce2546a)

M  +1    -1    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/3308dee942d1982a0aba68fc41368a284afc8e21