Bug 128498 - OPTIONS DIALOG: "Update Links when Loading" doesn't work for sections
Summary: OPTIONS DIALOG: "Update Links when Loading" doesn't work for sections
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Section Options-Dialog-Writer
  Show dependency treegraph
 
Reported: 2019-10-31 12:13 UTC by John
Modified: 2024-08-11 18:30 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
test document (10.56 KB, application/vnd.oasis.opendocument.text)
2019-11-05 11:05 UTC, John
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John 2019-10-31 12:13:31 UTC
Description:
1. Open Writer, ensure text boundaries are enabled:
   Menu bar > View > Text Boundaries = True.
2. Press the Enter button 5 times, return to the 1st line, type 2 or 3 short text lines, select them.
3. Menu bar > Insert > Section.
   In the Insert Section window:
     3.1. Section name (left column) = Foo
     3.2. Click the Insert button to create the section.

Now we are going to create a link to this section, i.e. to create its updatable copy.

4. Return to the last line.
5. Menu bar > Insert > Section.
   In the Insert Section window:
     5.1 Section name (left column) = Bar
     5.2. "Link" checkbox = True
     5.3. "Section" drop-down menu (which is located above the Write Protection section) = Foo.
     5.4. Click the Insert button to create the link to the Foo section.

Now you have 2 sections. The Foo section works as a source. The Bar section works as its mirror.

Each time you change the Foo section, you can click menu bar > Tools > Update > Links, and the Bar section will be changed accordingly.

You can close and open the document. When you open it, you will see a small window:

  The document test.odt contains one or more links to external data.
  Would you like to change the document, and update all links to get
  the most recent data? [Yes] [No]
  
A good alternative to manual updating.

However, this window is a bit annoying, isn't it? I think the anser is "yes". There is an option to avoid (i.e. to update links silently), but it doesn't work.

Click menu bar > Tools > Options > LibreOffice Writer > General > Update Links when Loading = Always.

Make some changes in you document, close it, open it. The "small window" is still here.

Notice that "Update Links when Loading = Never" works fine, though.

* * *

Tested with LO 6.2.7.1 and 6.4.0.0.alpha0+.

Version: 6.4.0.0.alpha0+ (x86)
Build ID: f0443fa4438aa98bce48bfd53dc6a687737687b6
CPU threads: 1; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 John 2019-10-31 12:18:08 UTC
There are some typos in my post.

> However, this window is a bit annoying, isn't it? I think the anser is "yes". > There is an option to avoid (i.e. to update links silently), but it doesn't work.

However, this window is a bit annoying, isn't it? I think the answer is "yes". There is an option to avoid it (i.e. to update links silently), but it doesn't work.

> Make some changes in you document, close it, open it. The "small window" is still here.

Make some changes in your document, close it, open it. The "small window" is still here.
Comment 2 Dieter 2019-11-04 15:55:45 UTC
I confirm it with

Version: 6.4.0.0.alpha1 (x64)
Build ID: cc57df8f942f239d29cb575ea5a7cb01405db787
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded
Comment 3 Xisco Faulí 2019-11-05 10:24:10 UTC
Hello John, Dieter,
Would it be possible to attach a document for easier reproduction ?
Comment 4 John 2019-11-05 11:05:16 UTC
Created attachment 155525 [details]
test document
Comment 5 John 2019-11-05 11:06:32 UTC
(In reply to Xisco Faulí from comment #3)

Thank you for interest. Test document is now attached to the initial post.
Comment 6 Xisco Faulí 2019-11-11 15:09:34 UTC
Reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default; 

but not in

Version: 5.0.0.0.alpha1+
Build ID: 0db96caf0fcce09b87621c11b584a6d81cc7df86
Locale: ca-ES (ca_ES.UTF-8)

must be bisected with 5.1 repo
Comment 7 Buovjaga 2019-11-11 19:43:29 UTC
Tried on Win, but seems impossible to bibisect: problem is not seen in the last commit of 5.1 repo, but is already in the first commit of 5.2 repo!

Tried git checkout HEAD~100 a couple of times with 5.1 repo starting from master in case it was some "fixed, broken again" type of story, but it kept working.
Comment 8 sdc.blanco 2020-01-14 00:19:36 UTC
I recognize that you are searching "back" in time-but this seemed the right place to note that in trying to reproduce this bug in 6.5.0.0.alpha, the link to the "source" file (and its section) is always lost in the mirror file. 

1.  Insert section (in mirror document), make link to "source" file (and its section).  (is loaded just fine).  
2.  Save "mirror document" (and check that link is still in section).
3.  Reload "mirror document"  (no query appears about external files) 

Result:  link (and file name) is gone from the section.
(with all 3 option settings (Always, On request, Never).

Version: 6.5.0.0.alpha0+ (x64)
Build ID: 035c7717c135c66c0ec025500b73ae9c13b7c586
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: GL; VCL: win; 
Locale: da-DK (en_DK); UI-Language: en-US
Calc: threaded
(7. jan. 2020 build)

Filed bug #129883 recently in relation to write protection and losing links in sections, but now believe that the general problem is that 6.5.0.0.alpha does not preserve "links" in reloaded documents (nothing to do with write protection.)
Comment 9 Dieter 2021-11-22 07:52:58 UTC
Still present in

Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 7b8f630db30ee0066a9f4b6e540368d2fcad7fa8
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Steps to reproduce
1. Open attchment 155125
2. Tools -> Options -> LibreOffice Writer -> General
3. Enable "Always" as option for "Update Links when Loading"
4. Add some text to first section.
5. Save document, close and reopen it

Actual result:
Message appears: "The document sections.odt contains one or more links to external data. Would you like to change the document, and update all links to get the most recent data? [Yes] [No]

Expected result:
No message or information about automatic update.
Comment 10 vatairethibault 2022-03-21 21:12:51 UTC
Hello,

On Debian Buster I can reproduce this bug since LibreOffice 4.4.4.3 (Version: 4.4.4.3 / Build ID: 2c39ebcf046445232b798108aa8a7e7d89552ea8 / Locale: fr_FR.UTF-8)

LibreOffice 4.4.4.2 (Version: 4.4.4.2 / Build ID: f784c932ccfd756d01b70b6bb5e09ff62e1b3285 / Locale: fr_FR.UTF-8) and earlier are not affected.
Comment 11 vatairethibault 2022-03-26 10:00:51 UTC
The bug is present since commit 59f9a0de39e4356220705bb6c4be66c956dc9c6d.
Comment 12 Buovjaga 2022-03-26 10:40:25 UTC
(In reply to vatairethibault from comment #11)
> The bug is present since commit 59f9a0de39e4356220705bb6c4be66c956dc9c6d.

That is https://git.libreoffice.org/core/commit/59f9a0de39e4356220705bb6c4be66c956dc9c6d
LinkUpdateMode is a global setting

That change is only about making the option global, so I don't think it caused the bug. Let's ask Stephan anyway.
Comment 13 vatairethibault 2022-03-26 12:24:22 UTC
(In reply to Buovjaga from comment #12)
> (In reply to vatairethibault from comment #11)
> > The bug is present since commit 59f9a0de39e4356220705bb6c4be66c956dc9c6d.
> 
> That is
> https://git.libreoffice.org/core/commit/
> 59f9a0de39e4356220705bb6c4be66c956dc9c6d
> LinkUpdateMode is a global setting
> 
> That change is only about making the option global, so I don't think it
> caused the bug. Let's ask Stephan anyway.

Sorry I did not provide you all the information.

If I build libreoffice from the previous commit (3782eb93ffb68a1291c95467176a703b1dad9b6d) the bug is not present.
If I build libreoffice from commit 59f9a0de39e4356220705bb6c4be66c956dc9c6d the bug is present.

Since this commit neither the "LinkUpdateMode" document setting, nor the "Update links when loading" option work.
Comment 14 vatairethibault 2022-03-26 16:36:16 UTC
Ok, I understand now how link update works :
Global settings take precedence over document settings (so LibreOffice always ignore the "LinkUpdateMode" document setting), and when "Always" is selected in global settings, links are only updated if the document is in a trusted file location (see Security > Macros security > Trusted sources > Trusted file locations).

Is this bug is related to this behavior ?
Comment 15 Stephan Bergmann 2022-03-30 13:28:45 UTC
(In reply to vatairethibault from comment #14)
> Ok, I understand now how link update works :
> Global settings take precedence over document settings (so LibreOffice
> always ignore the "LinkUpdateMode" document setting), and when "Always" is
> selected in global settings, links are only updated if the document is in a
> trusted file location (see Security > Macros security > Trusted sources >
> Trusted file locations).

The relevant commit <https://git.libreoffice.org/core/+/59f9a0de39e4356220705bb6c4be66c956dc9c6d%5E%21> "LinkUpdateMode is a global setting" was a mitigation for <https://www.libreoffice.org/about-us/security/advisories/cve-2015-4551/> "CVE-2015-4551 Arbitrary file disclosure in Calc and Writer".  From my private/security notes from back then:

"I have available a fix for LibreOffice that treats a document's 'always
update links' setting as if it rather were 'ask to update links' in Calc
and Writer unless

"(1) 'Tools - Options... - LibreOffice - Security - Macro Security... -
Security Level - Low (not recommended)' is selected; or

"(2) the document matches any of the 'Tools - Options... - LibreOffice -
Security - Macro Security... - Trusted Sources - Trusted File Locations.'

"That is probably a good compromise to make the new behavior actually
kick in for users, but without hampering considered-to-be-secure
scenarios with additional dialogs."
Comment 16 QA Administrators 2024-06-08 03:15:32 UTC Comment hidden (obsolete)
Comment 17 Buovjaga 2024-08-11 18:30:55 UTC
I see that per comment 15 this should be closed as notabug. Adjust the security levels as explained there.