Bug 159082 - Calc INDIRECT() links faulty in folders other than ~/documents on FILEOPEN
Summary: Calc INDIRECT() links faulty in folders other than ~/documents on FILEOPEN
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Calc-Function Files-Linked Regressions-row-height
  Show dependency treegraph
 
Reported: 2024-01-09 10:25 UTC by Jochen Schüttler
Modified: 2024-01-24 02:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test data, necessary to show the bug in another file (9.08 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-01-09 10:27 UTC, Jochen Schüttler
Details
link to the other file, this shows the bug (8.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-01-09 10:27 UTC, Jochen Schüttler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Schüttler 2024-01-09 10:25:15 UTC
Description:
Disclaimer: This is the German version of LibreOffice on German Linux, so in fact it's INDIREKT() and ~/Dokumente. Maybe the bug happens only in that setting.
In a Calc spreadsheet, in a cell I have a link to another file like this:
=INDIREKT("'./Testdaten.ods'#$Tabelle1.B2")
If both files are in ~/Dokumente, and I reopen the file with the link, I get a message that the links ("Verweise") weren't updated. I can allow the update and everything looks ok.
If both files are anywhere else, on clicking "allow update" I get a warning that the link couldn't be found, but then it is updated regardless. In "Bearbeiten->Verknüpfungen zu externen Dateien..." (edit->links to external files) I see that 2 absolute links have been created, one to file:///home/jochen/Dokumente/Testdaten.ods and one to <real location>/Testdaten.ods. If I delete any of the 2 links, the INDIRECT() is replaced with the referred value.

Steps to Reproduce:
1. change to a folder other than ~/Dokumente
2. create an .ods with some test data
3. create an .ods with a link to that test data (=INDIREKT("'./filename.ods'#$sheet.cell")
4. close and reopen the file with the link
5. allow updates
6. choose "Bearbeiten->Verknüpfungen zu externen Dateien..."
7. delete the wrong link there


Actual Results:
- warning on "allow updates"
- 2 absolute links in "Verknüpfungen", one correct, one to "~/Dokumente/filename.ods" as absolute path
- deleting the wrong link replaces the INDIREKT() link with the linked data.

Expected Results:
- no warning
- 1 correct link in "Verknüpfungen", either relative or absolute


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.4.1 (X86_64)
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 1 Jochen Schüttler 2024-01-09 10:27:02 UTC
Created attachment 191815 [details]
test data, necessary to show the bug in another file
Comment 2 Jochen Schüttler 2024-01-09 10:27:52 UTC
Created attachment 191816 [details]
link to the other file, this shows the bug
Comment 3 Buovjaga 2024-01-19 17:09:06 UTC
I tried with the test files that are attached, but there was no warning after allowing updating of links. Is the expectation that I should see the warning with the test files?

I only see one link in the file when I edit links.

I tried it from scratch, but I'm somehow too unfamiliar with such linking as I keep getting #REF! errors.

Arch Linux 64-bit, X11
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 18e579761cb622e8ff7e67f319ef80c61b3bd588
CPU threads: 8; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 19 January 2024
Comment 4 Jochen Schüttler 2024-01-22 07:50:29 UTC
The warning I described is flaky. The other issue is not.

So using my testfiles, you should see 2 links in ->edit->"links to external files" (or whatever it is called in English). You say there is only one link? Then maybe filesystem Btrfs is necessary to see the bug, or it is related to the German localization.
Comment 5 Stéphane Guillou (stragu) 2024-01-24 02:39:32 UTC
I can reproduce.

Tested with attached files:
* allowed updating links from banner
* warning showed: "external file could not be loaded" -> clicked OK
* Tools > Links to External Files shows two links: one relative (correct), one absolute (wrong)
* Deleting the absolute link (Break Link > Yes) and closing the dialog replaces the INDIRECT() formula with the value 1.

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

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

Also in 6.2.0.3, but not in 6.1.0.3 -> regression.

Bibisected with linux-64-6.2 repo to first bad build [5d007cfc8733799cf0535eac3e482eb8cae4b908] which points to:

commit 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b
author	Vasily Melenchuk 	Fri Apr 06 20:19:10 2018 +0300
committer	Thorsten Behrens 	Fri Jun 08 00:47:06 2018 +0200
tdf#62268: allow row height recalculation on document load
Reviewed-on: https://gerrit.libreoffice.org/52521

Same as Windows-only bug 146529.

Vasily, can you please have a look?