Bug 144532 - Closing Mail merge wizard removes its data source from Registered databases
Summary: Closing Mail merge wizard removes its data source from Registered databases
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.2.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2021-09-16 08:08 UTC by NISZ LibreOffice Team
Modified: 2021-09-28 12:29 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the attachment 174941 in Writer (96.13 KB, image/png)
2021-09-16 08:08 UTC, NISZ LibreOffice Team
Details
Opening the Mail Merge wizard (91.47 KB, image/png)
2021-09-16 08:09 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Writer with the data source gone (89.16 KB, image/png)
2021-09-16 08:09 UTC, NISZ LibreOffice Team
Details
attachment 174941 saved without the data source (12.62 KB, application/vnd.oasis.opendocument.text)
2021-09-16 08:09 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-16 08:08:42 UTC
Created attachment 175049 [details]
Screenshot of the attachment 174941 [details] in Writer

When a mail merge document contains embedded data source information, opening the file registers the data source.
Opening the Mail Merge wizard and closing it with Cancel removes this registration from the Data Sources panel and Registered Databases dialog.
Even after this the displayed records can be changed with the left-right icons on the MM toolbar. 
Saving and reloading the file loses the data source connection information permanently.

Steps to reproduce:
    1. Download  attachment 174941 [details] from bug 144425 and save ODS attachment 174942 [details] to the Documents folder
    2. On the Mail Merge toolbar open the Data Sources view, you should see the Teszt-level data source
    3. Open the Mail Merge wizard from the Tools menu or MM tollbar
    4. Close it immediately

Actual results:
The Teszt-level data source is gone from the Data Sources view.

Expected results:
The Teszt-level data source should be kept.

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

Additional Information:
Bibisected using bibisect-win64-6.4 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=8c66efa030e98cfdf5da20be368566d64e43c5d1
author	Caolán McNamara <caolanm@redhat.com>	Thu Sep 05 12:22:38 2019 +0100
committer	Caolán McNamara <caolanm@redhat.com>	Thu Sep 12 20:28:14 2019 +0200

weld OCopyTableWizard cluster

Adding CC to: Caolán McNamara
Comment 1 NISZ LibreOffice Team 2021-09-16 08:09:19 UTC
Created attachment 175050 [details]
Opening the Mail Merge wizard
Comment 2 NISZ LibreOffice Team 2021-09-16 08:09:37 UTC
Created attachment 175051 [details]
Screenshot of the problem in Writer with the data source gone
Comment 3 NISZ LibreOffice Team 2021-09-16 08:09:56 UTC
Created attachment 175052 [details]
attachment 174941 [details] saved without the data source
Comment 4 Caolán McNamara 2021-09-22 09:27:47 UTC
reverting that patch a 6-4 tree does change how it behaves so I can confirm that
Comment 5 Caolán McNamara 2021-09-22 13:43:37 UTC
looks like its the preview widget which uses a writer document deregisters it but it also looks like this just didn't happen before this commit because of a leak and a missing dtor call for the preview widget
Comment 6 Caolán McNamara 2021-09-28 09:46:27 UTC
https://gerrit.libreoffice.org/c/core/+/122763 is my stab at resolving this
Comment 7 Commit Notification 2021-09-28 11:04:27 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#144532 closing mail merge wizard preview removed document's data source

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 8 Caolán McNamara 2021-09-28 11:05:15 UTC
this appears to work in trunk, backport to 7-2 in gerrit
Comment 9 Commit Notification 2021-09-28 12:29:21 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/83876642498b0203b25b8b95e612603d46addd62

tdf#144532 closing mail merge wizard preview removed document's data source

It will be available in 7.2.3.

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.