Created attachment 155010 [details] Sample file wither header on page 2 Mail merge to a single document doesn't correctly replace fields in headers/footers if the first page doesn't have a header/footer, but following ones do. Steps to reproduce: 1) open attached sample document "header_from_page2_on.odt" 2) start mail merge wizard ("Tools" -> "Mail Merge Wizard") 3) click through the wizard and select to print a letter using any data source, e.g. the attached ODS sheet 4) Click "Save Merged Documents" item in the mail merge toolbar 5) select "Save as a single large document" and "Save Document" 6) save and open the resulting file Result: The header on the second page for every data set contains the text "Page 2 of 8" (with fields being used). Expected result: The header on the second page for every data should contain the text "Page 2 of **2**" (since the printout for every recipient has only 2 pages) Note: The sample document doesn't have a header in the page style for the first page, but does have one for the pages style of the second page. It works as expected if the first page also has a header (e.g. it is assigned the "Default Style" as well).
Created attachment 155011 [details] Sample data for mail merge
Self-confirming since the issue has originally been reported by somebody else in our internal issue tracker. I've already analyzed this and will submit a patch to Gerrit soon.
Pending fix: https://gerrit.libreoffice.org/80814 Unit test: https://gerrit.libreoffice.org/80815
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9271152c5fb64a698de167861e39f6b073a60ad6 tdf#128148 SwDoc::Append: Copy page descs if any has header/footer It will be available in 6.4.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.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/758516295e5f69393bd78bb4af6e7214d48ece0b tdf#128148 Add unit test It will be available in 6.4.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.
Fixed in master, backport for 6.3 pending at: https://gerrit.libreoffice.org/#/c/80859
Michael Weghorn committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/commit/d13d12101bb556da494ae0590ee47c1a2ba602b5 tdf#128148 SwDoc::Append: Copy page descs if any has header/footer It will be available in 6.3.4. 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.
Hello Michael. Please see Bug 137510, looks similar. I wanted to verify this one but attached odt is not mail merge document. Otoh, bug 124550 seems duplicate by version.
(In reply to Timur from comment #8) > Hello Michael. > Please see Bug 137510, looks similar. That actually sounds similar, will keep it in mind but don't really have time to look deeper into it at the moment. > I wanted to verify this one but attached odt is not mail merge document. > Otoh, bug 124550 seems duplicate by version. The attached doc just uses the "page count" statistics field, which was already enough to reproduce the issue. It wasn't even necessary to insert any data from an actual data source, i.e. you could choose anyone you like to reproduce, the actual data in it don't matter.