ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.92k stars 1.1k forks source link

Extra blank page in the end of doc and weird behaviour of mailmerge fields in the footer #2135

Open aol-nnov opened 1 year ago

aol-nnov commented 1 year ago

This issue is unique.

Operating System of DocumentServer

Docker

Version information

7.1

Expected Behavior

Mail merge template document combined with data provided. Total number of pages in the resulting document equals number of pages in the template ⨉ number of data rows.

Actual Behavior

Total number of pages in the resulting document equals number of pages in the template ⨉ number of data rows plus one empty page in the bottom of the document caused by last section break.

If that section break is manually removed, then mailmerge data in footer is instantly lost in the whole documetn. Strings become fields again

Reproduction Steps

please find the minimal example attache

Additional information

None of three recent versions (7.1, 7.2 and 7.3) work as expected.

aol-nnov commented 1 year ago

mailmerge-footer-bug.zip

usage hints:

npm install

bash ./start_docserver.sh 7.1
node ./server.js
node mailmerge.js

teardown:

bash ./stop_docserver.sh

find merge results in MailMergeResult.docx check if all fields are populated, then remove last section break. Check fields in the footer. Note, that fields in the document body are not affected.

aol-nnov commented 1 year ago

MailMergeResult.docx - note extra blank page at the end MailMergeResultBrokenAfterManualEdit.docx - note broken fields in the footer after removing last section break

Rita-Bubnova commented 1 year ago

Hello, @aol-nnov. Sorry for late response, seems we missed this issue. DocumentServer v7.4.1 is released. Please state is this problem still actual for you?

aol-nnov commented 1 year ago

Hi, @Rita-Bubnova yes, this one is still actual for us, as well as #2134

XDmitryK commented 1 year ago

@aol-nnov Hi Can you attach a file to the mailing data? In your file with my test data for mailing, an empty page is not added TestResultFile.docx

aol-nnov commented 1 year ago

@XDmitryK please find files and scripts in earlier comment

I've just re-run it against 7.4.1 with the same results.

aol-nnov commented 1 year ago

Well, to make it clear, I've updated onlyoffice desktop editors to 7.4.1, then downloaded mailmerge-footer-bug.zip from my earlier comment to make sure we have 100% identical inputs.

Then:

npm install

bash ./start_docserver.sh 7.4.1
node ./server.js
node mailmerge.js

Here is the mailmerge result: MailMergeResult.docx

And both issues are reproduced:

While re-running these tests stumbled upon another (confirmed) bug: https://github.com/ONLYOFFICE/DesktopEditors/issues/1321 :)

XDmitryK commented 1 year ago

@aol-nnov Thank you for testing this case on version 7.4.1. Unfortunately, we cannot reproduce your case on our test bench, it takes a little more time.

aol-nnov commented 1 year ago

we cannot reproduce your case on our test bench

But can you reproduce it with the sample scripts attached, @XDmitryK ?

To be frank, I'm unable to see any impact made by the scripts themselves. So, it's either documentserver (which I download from Docker Hub), or desktop editor (which I download from OnlyOffice site)...

XDmitryK commented 1 year ago

@aol-nnov I can confirm - this is bug, issue #63722