Bug 153804 - Footnotes disappear or move in docx file
Summary: Footnotes disappear or move in docx file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.6.2 release
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:24.2.0 target:7.5.6 target:7.6...
Keywords: bibisected, bisected, filter:docx, regression
: 155815 156212 (view as bug list)
Depends on:
Blocks: DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2023-02-24 13:20 UTC by alidostnuman
Modified: 2023-07-17 13:41 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
footnotes disappearing on libre office writer 7.5 with mac os 13.1.3 (19.80 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-02-25 06:48 UTC, alidostnuman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alidostnuman 2023-02-24 13:20:34 UTC
Description:
All the footnote content disappeared in docx format writer document with comments after I updated to LibreOffice 7.5, opened the document, worked on it and resaved it.
I pasted the text into a new document (again docx) as unformatted text, again added the footnotes and comments and saved it. It deleted the first footnote's text content and moved all other text content under the first footnote. I was working on a MacBook Air 2021 M1 chip with MacOS Ventura 13.2.1 .

Steps to Reproduce:
1. write text
2. add footnote and content
3. save and close
4. reopen document
5. footnote content not there

Actual Results:
Footnote content disappears

Expected Results:
footnotes should save and reopen


Reproducible: Always


User Profile Reset: No

Additional Info:
thnx
Comment 1 Xisco Faulí 2023-02-24 13:26:30 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 2 m_a_riosv 2023-02-24 16:31:30 UTC
Could be a duplicate of tdf#139835?
Comment 3 alidostnuman 2023-02-25 06:48:57 UTC
Created attachment 185579 [details]
footnotes disappearing on libre office writer 7.5 with mac os 13.1.3
Comment 4 Lesline 2023-02-28 04:41:06 UTC
Hello.

Thank you for reporting the bug.

You do specify that the bug was found using MacOS.  I was unable to reproduce the bug in Windows using the steps provided.  The builds used for testing were:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a834bbad8295cba0ca88a91a524aad48640271ec
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded


Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Kind Regards
Comment 5 Stéphane Guillou (stragu) 2023-03-12 21:16:21 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-03-12 21:28:40 UTC
Apologies, I did something wrong in my testing in comment 5.
I do see the reshuffling of footnotes, already visible in 7.4:

Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

but not in 7.3 (each footnote has one paragraph of text):

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

The issue is still reproducible in a master build from today, and it is similar to bug 152203 and bug 153255 but started at a different point.
Comment 7 Stéphane Guillou (stragu) 2023-03-13 13:11:06 UTC
Bibisected with linux-64-7.4 repo to first bad commit 56e1598c747e5a25d262921bd5fa8dc59ebbd902 which points to a cherrypick of core commit:

commit 96a856f87f16cca2e039c973c18d57c8b9dca362
author	László Németh <nemeth@numbertext.org>	Fri Dec 16 13:20:25 2022 +0100
committer	László Németh <nemeth@numbertext.org>	Mon Dec 19 07:34:36 2022 +0000
tree ecd09006d34dda3eac54afbb96dea016092d6c25
parent d640bfe7767292c8a89de57d378dd752a8ec8342
tdf#152206 DOCX import: fix mixed first footnote
Also the first footnote can be at arbitrary
place in footnote.xml.
Follow-up to commit 09ae3c01940bbc25ffde51963683b04e3cb4bb6a
"tdf#152203 DOCX import: fix mixed footnotes/endnotes".
Change-Id: Iab356f7373483d812f0e802a994357fdad831d9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144380

László, more footnotes fun. Can you please have a look?

Note that before that commit, the footnotes were already bad in a different way: footnote 1 was fine, footnotes 2 to 5 contained the same, repeated text. Correct behaviour can bee seen in 7.3 (I believe, but alidostnuman can correct me if I'm wrong).

Fix for bug 76260 introduced regression bug 152203, whose fix had follow-up in bug 152506, whose fix introduced this regression.

Bug 153255 remains to be fixed too, which was also introduced by the fix for bug 76260.
Comment 8 László Németh 2023-07-07 10:04:27 UTC
*** Bug 155815 has been marked as a duplicate of this bug. ***
Comment 9 László Németh 2023-07-07 10:06:06 UTC
Proposed fix in https://gerrit.libreoffice.org/c/core/+/154147

@Alidostnuman & all: many thanks for the bug report and handling the issue!
Comment 10 Commit Notification 2023-07-09 12:31:42 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6d153fa9f5277b7324885e18b0a63e1af830b6c5

tdf#153804 DOCX import: fix lost footnotes in case of comments

It will be available in 24.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 11 Commit Notification 2023-07-09 19:42:15 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/1e9e2ff5316a6d934205f1c01a57f80ef4e8657d

tdf#153804 DOCX import: fix lost footnotes in case of comments

It will be available in 7.5.6.

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 12 Commit Notification 2023-07-09 19:43:18 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#153804 DOCX import: fix lost footnotes in case of comments

It will be available in 7.6.0.2.

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 13 Stéphane Guillou (stragu) 2023-07-09 21:08:28 UTC
*** Bug 156212 has been marked as a duplicate of this bug. ***
Comment 14 B. 2023-07-10 09:00:30 UTC
Dear Stéphane,

thanks, no they are here, when I add comments, close and reopen then sometimes but not always footnotes are gone aor are mixed up....

I had that already once, reported, and as far as I could see it was fixed.

Thanks

Bülent
Comment 15 Stéphane Guillou (stragu) 2023-07-11 09:39:52 UTC
alidostnuman, you can test the fix in the latest master build: https://dev-builds.libreoffice.org/daily/master/current.html

B., unfortunately the Linux builds need to catch up but you should soon be bale to also test by downloading from the same page.
Comment 16 Commit Notification 2023-07-12 07:18:23 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-5":

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

tdf#153804 DOCX import: fix lost footnotes in case of comments

It will be available in 7.5.5.

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 17 Stéphane Guillou (stragu) 2023-07-17 13:41:25 UTC
Verified as fixed in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 46d7119b8be03968017e59d882e5671350304e15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks László!