Bug 159378 - In fods spreadsheets, external links to files in separate directories fail
Summary: In fods spreadsheets, external links to files in separate directories fail
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-25 20:20 UTC by Mr Mac
Modified: 2024-01-25 22:50 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mr Mac 2024-01-25 20:20:09 UTC
Description:
External file links between two fods spreadsheets in separate directories fail. This seems like a glaring bug, but I can't figure out what I am doing wrong.

When the file with the reference is opened, a popup appears: "The following external file could not be loaded...".  Updating the link with Edit->"Links to External Files", fixes the problem (though an incorrect path is still shown) until the file is saved and re-opened.

I have not seen this behavior between ods files or if the two fods files are in the same directory.

This happens independent of whether Tools->Options->Load/Save->General->"Save URLs relative to file system" is enabled or disabled.

Steps to Reproduce:
1.Create two little fods spreadsheets:
/home/xxx/Documents/LOtest/a/a.fods, constant value in cell A1
/home/xxx/Documents/LOtest/b/b.fods, cell A1 has an external reference to A1 in a.fods:
  ='file:///home/xxx/Documents/LOtest/a/a.fods'#$Sheet1.A1
2. This works until b.fods is closed and re-opened.  On re-opening, an error is reported in a popup:  "The following external file could not be loaded...   file:///home/xxx/Documents/LOtest/b/a/a.fods". Note that directory a is shown to be a sub-directory of b, not a sibling.
3. Doing "Edit->Links to External Files" shows the incorrect path to a.fods, containing b/a.  If one then does a Modify and selects b.fods with the correct path, the window still shows the incorrect path, containing b/a, but an Update will find a new value in a.fods.  This works until b.fods and closed and re-opened, whereupon the link is again broken.


Actual Results:
Link to external fods file in another directory is broken after an open.

Expected Results:
After a fods file open, the file path in the link to an external file should be correct, and any cells correctly updated.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.4.1 (X86_64)
Build ID: 60(Build:1)
CPU threads: 2; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Fedora 39, Workstation, with files on an ext4 file system
Comment 1 Eike Rathke 2024-01-25 22:50:21 UTC
Confirmed.
The stored <table:table-source ... xlink:href="../a/a.fods" .../> in b/b.fods is correct. Note this is Flat ODF, otherwise for zipped .ods it would have to be ../../a/a.fods (one more ../ to escape the package). That might be where loading gets confused (untested).