Bug 156499 - Field's value don't update when open DOCX with custom fields configured
Summary: Field's value don't update when open DOCX with custom fields configured
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-Fields
  Show dependency treegraph
 
Reported: 2023-07-27 18:25 UTC by giovani
Modified: 2023-08-16 21:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
document with field value problem (5.19 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-07-27 18:28 UTC, giovani
Details
Word with the update box disabled (47.00 KB, image/png)
2023-08-03 22:58 UTC, Gabor Kelemen (allotropia)
Details
Word with the update box enabled, I chose yes at the opening time dialog (41.40 KB, image/png)
2023-08-03 22:59 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description giovani 2023-07-27 18:25:47 UTC
Description:
Hi, everyone!

In LibreOffice 7.4.X version, on Writer, when I have a document with custom fields configured in Insert -> Field -> More Fields... -> DocInformation, when I open the document the field value does not update and the placeholder value remaining in place.

Going into the field configuration in version 7.4.X, the option "fixed content" is checked. Unchecking this option, the value update.

However when I open the same file in version 7.3.X this option is not checked and the field value is already updated.

Were there any changes in this aspect between versions? Is it possible to manipulate this value so that doesn't come checked as default? (Like it was in 7.3.X version)

I'm attaching a document with a configured field as I mentioned.


thanks in advance,
Giovani

Actual Results:
when opening the document the field comes with the placehoder value.

Expected Results:
when opening the document the field comes with the value updated.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.4.7.2 (x64) / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: pt-BR (pt_BR); UI: pt-BR
Calc: CL
Comment 1 giovani 2023-07-27 18:28:46 UTC
Created attachment 188601 [details]
document with field value problem
Comment 2 Gabor Kelemen (allotropia) 2023-08-03 19:29:40 UTC
Confirming with

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: eff5a3fe98ca5d1d28c4f5386c4af8a3be8f5703
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

Seems to have started with:
https://git.libreoffice.org/core/+/c4cb1d1dd581a5f120d9cf8b1d4274ec38f3eabe

author	Justin Luth <justin_luth@sil.org>	Sat Mar 12 11:11:01 2022 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Fri Mar 25 13:48:12 2022 +0100

tdf#147861 writerfilter: use GetFieldResult, not current DocProperty

Adding CC to: Justin Luth
Comment 3 Justin L 2023-08-03 20:36:41 UTC
What happens on a Microsoft system? Does the field update on those systems?

When I open "doc download.docx" in MS Word 2010, I see "My name is [nome]" placeholder - which is the same as LO 7.4/24.2. So the current behaviour is correct.

Because the file is saved in DOCX format, it needs to behave in the way that MS Word expects it to behave. (Unfortunately, LO needs to be extended to support both visual compatibility and F9 update-ability.)

If you want it to act "sanely", then you need to use ODF formats.

This can probably be marked as a duplicate of bug 98284. As OP noted, instead of pressing F9 to update, the current way to "update" these fields in LO is to edit them and remove the fixed flag. The topic of bug 98284 is that a soft-lock needs to be introduced into LO - one that prevents auto-update but doesn't block an F9.

*** This bug has been marked as a duplicate of bug 98284 ***
Comment 4 Gabor Kelemen (allotropia) 2023-08-03 22:57:21 UTC
(In reply to Justin L from comment #3)
> What happens on a Microsoft system? Does the field update on those systems?
> 

It depends! First, the document somehow(it was last saved by LO, but saving the doc from Word 2010/16 removes it) has the w:updateFields attribute set to true in settings.xml of which the standard says:

17.15.1.90
updateFields (Automatically Recalculate Fields on Open)
This element specifies whether the fields contained in this document should automatically have their field result
recalculated from the field codes when this document is opened by an application which supports field
calculations. [Note: Some fields are always recalculated (e.g. the page numbering), therefore this element only
affects fields which are typically not automatically recalculated on opening the document. Also note that this
setting must not supersede any document protection (§17.15.1.29) or write protection (§17.15.1.93) settings.
end note]
If this element is omitted, then fields should not automatically be recalculated on opening this document.

To add to the fun, Word 2010 and newer have this setting in the Options - Advanced - General called "Update automatic links on open". 
If this is disabled, then the field is not updated, if it's enabled, then you get a question at opening the file whether you want to update the fields.

Perhaps a new, document level property can help here?
Comment 5 Gabor Kelemen (allotropia) 2023-08-03 22:58:24 UTC
Created attachment 188754 [details]
Word with the update box disabled
Comment 6 Gabor Kelemen (allotropia) 2023-08-03 22:59:27 UTC
Created attachment 188755 [details]
Word with the update box enabled, I chose yes at the opening time dialog
Comment 7 giovani 2023-08-16 21:08:26 UTC
Hi guys!

Thanks you all the feedback about this subject.

I think the main problem in my case is that in LO 7.3 I don't have this "fixed content" pre-checked and in LO 7.4 I did.

Why this behavior changes from LO 7.3 to LO 7.4 version? It's the same document with two different behaviors.

When Justin L says "(Unfortunately, LO needs to be extended to support both visual compatibility and F9 update-ability.)".

What "needs to be extended" is? Is some software to be installed?

Is there anything that I can do to maintain the behavior of the LO 7.3 version? In other words, is there anything that I can do to this custom fields update automatically?

I appologize my lack of knowledge on this subject.

Thank you all again,
Giovani Valle Dalbosco