Bug 166398 - Hidden section reappears after save and reload when condition includes field name with an accented character
Summary: Hidden section reappears after save and reload when condition includes field ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.2.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:26.8.0
Keywords:
Depends on:
Blocks: Section
  Show dependency treegraph
 
Reported: 2025-04-29 19:47 UTC by Miguel Pineau
Modified: 2026-01-02 14:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
a file ods and file odt (38.55 KB, application/x-zip-compressed)
2025-04-29 19:47 UTC, Miguel Pineau
Details
video mp4 zip (27.58 MB, application/x-zip-compressed)
2025-04-29 19:57 UTC, Miguel Pineau
Details
new test with version 25 (4.24 MB, video/mp4)
2025-05-25 12:43 UTC, Miguel Pineau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Pineau 2025-04-29 19:47:55 UTC
Created attachment 200609 [details]
a file ods and file odt

The idea is that when mailing with LibreOffice Writer. Certain sections of the text are hidden under certain conditions.

click on the « Edit » menu, then on « Exchange database » and define the file « tableau.ods ».
designate a paragraph as a section
check “hide” in « edit section »
enter « état== "visible" »

The entire section disappears.

When you close and save the file. When opened, the section reappears.

sample files attached

video available if desired
Comment 1 Miguel Pineau 2025-04-29 19:57:05 UTC
Created attachment 200610 [details]
video mp4 zip
Comment 2 Gary Kuepper 2025-05-25 12:02:34 UTC
I was unable to reproduce the bug in version 25.2.2.2  release on windows
Comment 3 Miguel Pineau 2025-05-25 12:32:29 UTC
(In reply to gkuepper from comment #2)
> I was unable to reproduce the bug in version 25.2.2.2  release on windows

Hello,
Can you film what you've done?
I just did it again with another document.
I started my video by showing that I'm on LibreOffice 25.
Comment 4 Miguel Pineau 2025-05-25 12:43:11 UTC
Created attachment 200954 [details]
new test with version 25
Comment 5 Buovjaga 2025-12-26 20:10:31 UTC
Repro with steps from comment 0 and the files (using état=="visible" as the condition).

This has never worked. Earlier the section did not even become invisible upon inserting. The state where it became invisible, but reappeared upon saving and reload started in 24.2 with commit ff7f1b59e22092d8548459e75fe912db852f056f
tdf#159565 prerequisite: make hidden sections have zero-height frames

If I modify the .ods and change état to etat, it works fine. So Miguel can use this as a workaround for now.

Arch Linux 64-bit
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 640a35801612123fa503fa72e8732cfb7e75caca
CPU threads: 8; OS: Linux 6.18; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 23 December 2025
Comment 6 Mike Kaganski 2025-12-29 10:05:20 UTC
(In reply to Miguel Pineau from comment #0)
> The idea is that when mailing with LibreOffice Writer. Certain sections of
> the text are hidden under certain conditions.
> 
> click on the « Edit » menu, then on « Exchange database » and define the
> file « tableau.ods ».
> designate a paragraph as a section
> check “hide” in « edit section »
> enter « état== "visible" »

Hmm. And what is the expectation for this condition? what is `état`?

The documentation [1] explains, that for database fields, the syntax is "Database.Table.Field"; and for this case (based on the video linked to comment 1), it should be « tableau2.Feuille1.état=="visible" ».

The situation that using a faulty condition, it works erratically - is bad of course. But with the correctly defined condition, it works for me as designed: when I define a mail merge database (using mail merge wizard), and then use Mail Merge toolbar to navigate the records, the sections using the hide conditions show and hide as expected, including after save-and-reload.

[1] https://help.libreoffice.org/25.8/en-GB/text/swriter/01/04090200.html?&DbPAR=WRITER
Comment 7 Mike Kaganski 2025-12-29 10:22:28 UTC
Olivier: do you think this could be a documentation issue, where https://help.libreoffice.org/25.8/en-GB/text/swriter/01/04020100.html?&DbPAR=WRITER tells

> With condition
> Enter the condition that must be met to hide the section. A condition is a
> logical expression, such as "SALUTATION EQ Mr.". For example, if you use the
> mail merge form letter feature to define a database field called "Salutation"
> that contains "Mr.", "Ms.", or "Sir or Madam", you can then specify that a
> section will only be printed if the salutation is "Mr.".

and reading it, it *looks* as if one really should enter "SALUTATION EQ Mr." to refer to "SALUTATION" field in a database field - while the correct information is presented in https://help.libreoffice.org/25.8/en-GB/text/swriter/01/04090200.html?&DbPAR=WRITER ?
Comment 8 Commit Notification 2026-01-02 14:29:59 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/c59b532d38f8f706e56fe4ceb1177bc6344bba07

tdf#166398 Improve section control example