Bug 154427 - Conditional-text field is empty when exporting a document as EPUB directly or with layout method "Reflowable"
Summary: Conditional-text field is empty when exporting a document as EPUB directly or...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: EPUB-Export
  Show dependency treegraph
 
Reported: 2023-03-28 15:05 UTC by Paddy Landau
Modified: 2023-04-16 17:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODT document with a non-blank conditional-text field (47.50 KB, application/vnd.oasis.opendocument.text)
2023-03-28 15:06 UTC, Paddy Landau
Details
Sample resulting EPUB document with missing non-blank conditional-text field (23.09 KB, application/epub+zip)
2023-03-28 15:07 UTC, Paddy Landau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paddy Landau 2023-03-28 15:05:38 UTC
Description:
I have a large document that contains many conditional-text fields.

I need to export the document as EPUB.

Exporting as PDF works perfectly, but when exporting as EPUB, all of the conditional-text fields are empty.

Note: I don't expect the EPUB to contain dynamic fields; it's OK to export the currently-displayed text as fixed text, exactly as exporting to PDF does.

I export using the menu File > Export As > Export as EPUB.

I shall add two attachments to this bug report:

• Sample document in LibreOffice
• The resulting EPUB

How do I fix this so that the conditional text is exported to the EPUB, please?

Steps to Reproduce:
1. Create a document with at least one conditional-text field. You can use the sample document that is linked in the OP.

2. Set the condition so that text is displayed in the field, i.e. the conditional-text field isn't empty.

3. (Optional) File > Export As > Export as PDF

4. File > Export As > Export as EPUB

Actual Results:
The EPUB file leaves the conditional-text field empty. Looking at the XML file inside the EPUB file, there is no text there; only redundant formatting instructions remain.

Expected Results:
The EPUB file should have contained the conditional text, exactly as an export to PDF does. (You can see this from the PDF file from the optional step 3 above.)


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Tested on three setups:

1. Linux Ubuntu 22.04

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Flatpak
Calc: threaded

2. Windows 11

Version: 7.4.6.2 (x64) / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 4; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: CL

3. Windows 11

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 4; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: CL threaded
Comment 1 Paddy Landau 2023-03-28 15:06:50 UTC
Created attachment 186263 [details]
Sample ODT document with a non-blank conditional-text field
Comment 2 Paddy Landau 2023-03-28 15:07:35 UTC
Created attachment 186264 [details]
Sample resulting EPUB document with missing non-blank conditional-text field
Comment 3 Paddy Landau 2023-04-01 14:31:41 UTC
Update: It seems that a number of field types are left empty on export to EPUB, such as document information and cross-references. They should all be included in the export to EPUB.
Comment 4 Dieter 2023-04-16 16:22:54 UTC
I've tested following methods of epub-export
1. Export as EPUB -> Layout method: Reflowable => Reproducible
2. Export as EPUB -> Layout method: Fixed => not reproducible
3. Export directly as EPUB => Reproducible

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1e9f4de320f67d1218c710bcee1969a2324c6888
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

As far as I understand description of layout methods, display of conditional text shouldn't be depend on layout methods

=> NEW
Comment 5 Paddy Landau 2023-04-16 17:15:54 UTC
(In reply to Dieter from comment #4)
> I've tested following methods of epub-export…

Thank you. I confirm your results (version 7.5.2.2).

> … display of conditional text shouldn't be depend on layout methods

Yes, agreed. My document is awful when used with the "Fixed" method.