Bug 144427 - MAILMERGE Save all documents no longer generates all documents if custom From-To values were set
Summary: MAILMERGE Save all documents no longer generates all documents if custom From...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium minor
Assignee: Balázs Varga
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-10 08:39 UTC by NISZ LibreOffice Team
Modified: 2021-09-17 07:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the dialog in Writer after setting From and changing back (58.68 KB, image/png)
2021-09-10 08:39 UTC, NISZ LibreOffice Team
Details
Screenshot of the resulting two instead of three output files of a former run in the Save dialog (117.75 KB, image/png)
2021-09-10 08:39 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-10 08:39:10 UTC
Created attachment 174945 [details]
Screenshot of the dialog in Writer after setting From and changing back

When creating mail merges it is possible to set the merged document ranges with the From – To fields.
If you change the values there, then change your mind and select to save/print/email all documents, the previously set range is still used instead of generating all documents.

Steps to reproduce:
    1. Set up a mail merge document with the attachment 174941 [details] and attachment 174942 [details]
    2. In the Mail Merge toolbar press the Save Merged Documents button, but it also happens with the Print merged documents and Send Email Messages buttons too
    3. Under Save As Options, select the From option and set 2
    4. Change it back to Save as individual documents
    5. Press Save Documents
    6. Enter a name in the file save dialog.

Actual results:
Only two documents – contentwise the second and third – are saved, as set under the From option.

Expected results:
All three documents should be saved.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: c7b5e6566d9b24a0a996c739a945004d9aadee2f
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:
This started with:
https://git.libreoffice.org/core/+/ec44f87d5b99a3299322d0b79abc4c6808877865%5E%21

author	Balazs Varga <balazs.varga991@gmail.com>	Mon Mar 22 13:34:37 2021 +0100
committer	László Németh <nemeth@numbertext.org>	Wed Mar 31 12:24:22 2021 +0200

tdf#117212 sw mailmerge: merge only the selected range
Comment 1 NISZ LibreOffice Team 2021-09-10 08:39:31 UTC
Created attachment 174946 [details]
Screenshot of the resulting two instead of three output files of a former run in the Save dialog
Comment 2 Timur 2021-09-10 13:46:04 UTC
Yes. 
And from those bugs we see that File-Print and Mail Merge toolbar (probably email also) have a different logic.
With Mail Merge toolbar, we have populated from 1 to 3. With File-Print not, just 1 to 1. And that could be a bug. 

Now that you test many MM bugs, please see bug 140885. 
Instead of adding attachment 174942 [details] or database each time, that gives warnings when path is different, it would help us here.
Comment 3 Commit Notification 2021-09-13 06:16:58 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

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

tdf#144427 sw mailmerge: fix merge all document

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 4 Timur 2021-09-13 10:34:24 UTC
Upon another look, this dialog is wrong. 
It should have separate settings for Single/individual and From/To, as in File-Print, so that you can choose both output and records.
Comment 5 Timur 2021-09-13 10:41:34 UTC
I don't understand why there are those dialogs at all, it just duplicates code. 
I think it's enough, instead of buttons Save and Print that have their own logic, to have a single button that invokes File-Print dialog, that works fine (well, it needs bug 86672 and bug 47890).
Comment 6 NISZ LibreOffice Team 2021-09-13 13:22:36 UTC
(In reply to Timur from comment #5)
> I don't understand why there are those dialogs at all, it just duplicates
> code. 
> I think it's enough, instead of buttons Save and Print that have their own
> logic, to have a single button that invokes File-Print dialog, that works
> fine (well, it needs bug 86672 and bug 47890).

Those dialogs were simplified out of the MM Wizard around 5.0 or so. Before the MM Wizard had all of these options as wizard pages, complicating the process (especially for use cases when you already had set up the base document, the fields, data source and you just want to generate new merges from new data). 
Now the MM wizard is only 5 pages instead of 8 and some use cases are much simpler (at least in theory ;) )
Comment 7 NISZ LibreOffice Team 2021-09-13 14:47:11 UTC
(In reply to Timur from comment #4)
> Upon another look, this dialog is wrong. 
> It should have separate settings for Single/individual and From/To, as in
> File-Print, so that you can choose both output and records.

I'll file a new one about this, thanks for the idea :).
Comment 8 Timur 2021-09-13 19:43:51 UTC
I think Wizard is separate, I don't see a connection to Save/Print buttons in MM toolbar. 
I add Heiko here to see, although there will be a new bug.
Comment 9 NISZ LibreOffice Team 2021-09-14 09:08:40 UTC
Verified in: 

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 80a47aae1419842f4496f02028e2b49763aea25b
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 10 Commit Notification 2021-09-17 07:52:12 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

tdf#144427 tdf#144483 sw mailmerge: fix merge all document

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.