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.82k stars 1.08k forks source link

Editing file removes ContentControl CustomXMLPart binding (dataBinding tag removed on save) #2448

Open gpanayotov opened 12 months ago

gpanayotov commented 12 months ago

This issue is unique.

Operating System of DocumentServer

Linux (DEB package), Docker

Version information

7.4, 7.5

Expected Behavior

When editing a document with content control bound to a Custom XML Part and saving it the data binding should remain (w:dataBinding tag should remain) and not deleted

Actual Behavior

After i open a document with w:dataBinding in w:std and changing somethin otside this tag then after save the tag is removed from the new document

the part of the document.xml before editing with the editor is:

        <w:sdt>
            <w:sdtPr>
                <w:id w:val="2142771203" />
                <w:placeholder>
                    <w:docPart w:val="DefaultPlaceholder_-1854013440" />
                </w:placeholder>
                <w:dataBinding w:prefixMappings="xmlns:ns0='https://example.com/template' xmlns:ns1='http://www.w3.org/2001/XMLSchema-instance' " w:xpath="/ns0:Template[1]/ns0:Task[1]/ns0:Title[1]" w:storeItemID="{16BB3F27-6769-43F1-94EF-38FF097B8F79}" />
                <w:text />
            </w:sdtPr>
            <w:sdtContent>
                <w:p w:rsidR="00502058" w:rsidRDefault="00502058" w14:paraId="65D134F2" w14:textId="48E5E0A5">
                    <w:r>
                        <w:t xml:space="preserve">A.10 Test title</w:t>
                    </w:r>
                </w:p>
            </w:sdtContent>
        </w:sdt>

After saving the document the part of the xml looks:

        <w:sdt>
            <w:sdtPr>
                <w15:appearance w15:val="boundingBox"/>
                <w:id w:val="2142771203" />
                <w:placeholder>
                    <w:docPart w:val="DefaultPlaceholder_-1854013440" />
                </w:placeholder>
                <w:rPr></w:rPr>
            </w:sdtPr>
            <w:sdtContent>
                <w:p>
                    <w:pPr>
                        <w:pBdr></w:pBdr>
                        <w:spacing />
                        <w:ind />
                        <w:rPr></w:rPr>
                    </w:pPr>
                    <w:r>
                        <w:t xml:space="preserve">A.10 Test title</w:t>
                    </w:r>
                    <w:r></w:r>
                </w:p>
            </w:sdtContent>
        </w:sdt>

Reproduction Steps

  1. Create a docx file with content contro; field bound to CustomXMLPart or download the following file: test.docx
  2. Open the file
  3. Change something outside the content control
  4. Save the file
  5. Check the databinding tag

Additional information

No response

XDmitryK commented 11 months ago

@gpanayotov Hi Thanks for your feedback, I can confirm this is bug issue #64898