Bug 108572 - Mail merge: embedded database isn't properly discarded when working with MS Office starting documents
Summary: Mail merge: embedded database isn't properly discarded when working with MS O...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.0.beta2
Hardware: All All
: medium normal
Assignee: Szymon Kłos
URL:
Whiteboard: target:6.0.0 target:6.1.0 target:6.0.4
Keywords:
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2017-06-16 18:00 UTC by Aron Budea
Modified: 2018-09-03 10:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample starting document (DOCX) (17.17 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-06-16 18:00 UTC, Aron Budea
Details
Sample address list (7.85 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-06-16 18:00 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-06-16 18:00:14 UTC
Created attachment 134067 [details]
Sample starting document (DOCX)

Attaching an overly simplistic sample mail merge starting document (DOCX) and address list (ODS, but format doesn't matter), but the behavior is independent of the content.

- Open the starting document (DOCX).
- Start mail merge wizard.
- Jump to step 3. Insert address block, open Select Address List... and after clicking Add..., select the address list spreadsheet. Click OK in the dialog.
- Cancel mail merge wizard, and close Writer without saving anything.
- Restart LibreOffice, and check databases in Tools -> Options...; LibreOffice Base -> Databases.

=> There is a database with the address list spreadsheet file name ("data source" in the sample), and something like this for database file: "vnd.sun.star.pkg://file:%2F%2F%2FD:%2Fbug%2Fmm%20document.docx/EmbeddedDatabase"
Note that no such entry remains if the starting document is an ODT.

While nothing was saved in this case, the same thing happens if the document is saved as DOCX/DOC, as embedded database doesn't get saved in MS Office formats, yet the database remains in the list afterwards.

It would be great if defunct embedded database entries were removed on start in general (a crash with the file open could leave one even in case of ODTs).

Observed using LO 5.4beta2 / Windows 7.
Comment 1 Aron Budea 2017-06-16 18:00:45 UTC
Created attachment 134068 [details]
Sample address list
Comment 2 Aron Budea 2017-09-04 13:00:57 UTC
Other way to trigger this issue:

- Open the starting document (DOC or DOCX).
- Start mail merge wizard.
- Jump to step 3. Insert address block, open Select Address List... and after clicking Add..., select the address list spreadsheet. Click OK in the dialog.
- Click Finish.
- Close document without saving, or save the merged documents, or even the original, and close it.

=> Verify that in 'Tools -> Options...; LibreOffice Base -> Databases' that there is a database that points to the supposedly embedded database in the initial DOCX (the database connection can also be checked in Writer in View -> Data Sources).

The leftover database entry can be manually deleted in the Options dialog (could be useful for testing).


To reiterate, not embedding the database connection in the merged and saved DOCX is fine (that'd be a separate enhancement), this issue is only about the lingering entry in Registered Databases list.
Comment 3 Xisco Faulí 2017-09-07 08:14:15 UTC
Moving to ASSIGNED
Comment 4 Commit Notification 2017-09-07 09:53:32 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=26957fc325c27cf61e8ef5555b380d627def4931

tdf#108572 let remove storage element

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2017-09-07 09:53:37 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ba368643e6a0c5ac7a7b7ea8d72899d60b2a8331

tdf#108572 revoke connection if mail-merge is cancelled

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Szymon Kłos 2017-09-07 12:02:25 UTC
I also met problem with adding the same data source after manual delete using "Tools -> Options". One of my patches solved that.
Comment 7 Commit Notification 2017-09-09 09:43:13 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=97477ee5e11951a5a25a91b89f1b71a1b78ac8f5

tdf#108572 remove connections only for current shell

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2017-09-17 09:52:09 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=29bd193146b40cf90bda5db04b136987f3c7c94d

tdf#108572 remove connection also if not saved

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-04-09 09:04:59 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=91bb474cc5342b32dab6c701a1bea6c49b87f498

forcepoint#37 revert tdf#108572 let remove storage element

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2018-04-10 08:55:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8182037871daf1d94f4beff63afeb56b20055480&h=libreoffice-6-0

forcepoint#37 revert tdf#108572 let remove storage element

It will be available in 6.0.4.

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

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