Bug 144620 - UI: User entered e-mail data lost when MM toolbar is open
Summary: UI: User entered e-mail data lost when MM toolbar is open
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2021-09-20 10:59 UTC by NISZ LibreOffice Team
Modified: 2021-09-21 03:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the dialog before changes in Writer (78.51 KB, image/png)
2021-09-20 10:59 UTC, NISZ LibreOffice Team
Details
Screenshot of the dialog after changes in Writer – this would reset to the original values (74.41 KB, image/png)
2021-09-20 10:59 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-09-20 10:59:03 UTC
Created attachment 175136 [details]
Screenshot of the dialog before changes in Writer

When the Mail merge toolbar is opened and the Mail Merge E-mail options are set, those options can be lost.

Steps to reproduce:
    1. View – Toolbars – Mail Merge. 
This problem does not happen if the MM toolbar is not visible.
    2. Go to Options – Writer – Mail Merge Email
    3. Enter something in any of the Your name, Email address, Server name fields
    4. Press OK to close the dialog.
Note: Pressing Apply first and then OK does not trigger the problem.
    5. Open Options – Writer – Mail Merge Email again.

Actual results:
The values entered in step 3 are not retained, the previous values are present.
This is very visible when one opens a MM document with embedded data source, which autoshows the Mail Merge toolbar since 6.1.
Opening an existing document on a colleagues machine and then setting up e-mail credentials is a valid use case that makes this issue visible (at least this is how I noticed this issue).

Expected results:
The values entered in step 3 should be kept.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 770dcb1f717d576facf31efed14bee403e1a7155
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

and back to 5.3

Not yet in:
Version: 5.2.5.0.0+
Build ID: 78223678b7513ffe46804cb08f2dc5bc899b2bab
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; 
Locale: hu-HU (hu_HU); Calc: CL

Additional Information:
Bibisected using bibisect-win32-5.3 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=53423cb1f177369f72938ad45aa8a24568104e8e

author	Caolán McNamara <caolanm@redhat.com>	2016-07-28 16:23:53 +0100
committer	Caolán McNamara <caolanm@redhat.com>	2016-07-28 16:23:56 +0100
commit 53423cb1f177369f72938ad45aa8a24568104e8e (patch)

Resolves: tdf#98793 create a MailMergeConfigItem if toolbar is active...

Adding CC to: Caolán McNamara
Comment 1 NISZ LibreOffice Team 2021-09-20 10:59:23 UTC
Created attachment 175137 [details]
Screenshot of the dialog after changes in Writer – this would reset to the original values
Comment 2 Caolán McNamara 2021-09-20 12:02:07 UTC
I think there are two SwMailMergeConfigItem involved. One SwMailMergeConfigItem from the toolbar created and modified but not commited to the config. Then the other SwMailMergeConfigItem is created by the options dialog and commited on ok, but after that there in cui/source/options/treeopt.cxx at line 723 there is a utl::ConfigManager::storeConfigItems() to flush all outstanding config items, so the one belonging to the toolbar is now flushed after the options dialog one was written.
Comment 3 Caolán McNamara 2021-09-20 13:03:23 UTC
I see that SwMailMergeConfigItem right after ctor has IsModified() of true which doesn't seem right and seems to be an accidental side effect of using some convenience modifiers during the ctlr
Comment 4 Commit Notification 2021-09-20 18:48:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/45e8b85a50bf153b6c9f627e731eecee1cf966f2

Resolves: tdf#144620 toolbar config item overwrites options dialog one

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Caolán McNamara 2021-09-20 18:50:19 UTC
fixed in trunk and backport to 7-2 in gerrit
Comment 6 Commit Notification 2021-09-21 03:48:29 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/b8700e9d29e0ec2b8a91dd5a360ceee57a1f3c3d

Resolves: tdf#144620 toolbar config item overwrites options dialog one

It will be available in 7.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.