Bug 168921 - FILESAVE DOCX Documents having variables with empty names can't be opened in Word
Summary: FILESAVE DOCX Documents having variables with empty names can't be opened in ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Aron Budea
URL:
Whiteboard: target:26.2.0 target:25.8.3
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: DOCX-Corrupted DOCX-Fields
  Show dependency treegraph
 
Reported: 2025-10-17 14:09 UTC by Aron Budea
Modified: 2025-10-20 14:49 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample ODT with user field having empty name (7.60 KB, application/vnd.oasis.opendocument.text)
2025-10-17 14:09 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-10-17 14:09:18 UTC
Created attachment 203394 [details]
Sample ODT with user field having empty name

The attached document only has a user field that was created with empty name. Save it into DOCX, and try opening it in Word.

=> Word can't open the file cleanly. It points to /word/settings.xml as the source of the error.

The problem is the following part, in particular the empty name:
<w:docVars>
  <w:docVar w:name="" w:val=""/>
</w:docVars>

Also affects test file forum-fr-44499.odt.

Observed with LO 26.2.0.0.alpha0+ (8ea8e254a3151f5390f3a10ff156fcaf8e7c5d5c), 7.0.0.3 / Windows.

The issue started when the feature of exporting variables to DOCX got implemented in 7.0:
https://git.libreoffice.org/core/commit/ae5f469d3893de73850ccc369dbf426a4acd8f15
author		Miklos Vajna <vmiklos@collabora.com>	Thu Jan 30 17:56:53 2020 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	Thu Jan 30 22:20:43 2020 +0100

DOCX export: write document variables
Comment 1 Commit Notification 2025-10-18 11:18:08 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168921 sw: don't export user fields with empty names to DOCX

It will be available in 26.2.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 2 Commit Notification 2025-10-20 14:49:10 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/2c0f2c55ab43f39e54e8df9164665dd7544d8658

tdf#168921 sw: don't export user fields with empty names to DOCX

It will be available in 25.8.3.

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.