Bug 120744 - link to external data does not work when named range of cells containing linked formulas
Summary: link to external data does not work when named range of cells containing link...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.2.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-20 21:15 UTC by Edmund Laugasson
Modified: 2019-02-20 06:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
linked data autorefresh even works regardless of warning message (27.46 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-10-20 21:25 UTC, Edmund Laugasson
Details
here will be #REF! shown for linked data (22.90 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-10-20 21:28 UTC, Edmund Laugasson
Details
email formula that suppose to be (3.01 KB, text/plain)
2018-10-20 21:29 UTC, Edmund Laugasson
Details
email formula that has been overwritten (7.96 KB, text/plain)
2018-10-20 21:30 UTC, Edmund Laugasson
Details
password formula that suppose to be (1.76 KB, text/plain)
2018-10-20 21:30 UTC, Edmund Laugasson
Details
password formula that has been overwritten (5.33 KB, text/plain)
2018-10-20 21:31 UTC, Edmund Laugasson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edmund Laugasson 2018-10-20 21:15:40 UTC
Description:
when named range of cells containing linked formulas from other sheets then #REF! will be displayed instead of linked data

Steps to Reproduce:
1. create an .ods file with formulas that contain both linked and direct data
2. add name to range of cells both linked and direct data
3. add externally linked data to separate sheet both linked and direct data

Actual Results:
Formulas are overwritten with absolute path and therefore named cell range with linked data does not work anymore - formulas will be broken.

Expected Results:
Formulas are NOT overwritten and named cell range with linked data works like cell range with non-linked data. When data is located in same file there is no point to use absolute path in formulas if it is the same file. Possibly there could be the choice "Sheet->Link to internal data..." where I can choose named range cell(s) in same file - that seems to be solve such issue.


Reproducible: Always


User Profile Reset: No



Additional Info:
When adding external linked data, also dead links are created with no element. Actually https://help.libreoffice.org/6.1/en-US/text/shared/01/02180000.html?System=UNIX&DbPAR=CALC#bm_id48899801 says that Element means "Lists the application (if known) that last saved the source file" but this is not true. The Element is actually the named cell range that has been used when external data link was created. Later I can change that named cell range by choosing "Edit->Links to External Files..." and after selecting appropriate line, click Modify... button and there is possible to change "Available Tables/Ranges" what are exactly those named range of cells. So - please fix also help text.

In addition "Edit->Links to External Files..." shows dead link with no Element referred. Possibly also such dead links are causing issue(s).

In addition while opening such file, the warning message "Automatic update of external links has been disabled" will be displayed. When trying to click "Enable Content" then message "The following external file could not be loaded. Data linked from this file did not get updated" and then gives full path to file, e.g. file:///home/student/testing/bug-link-to-external-data.ods and only choice is OK button. At the same time all data is updated as needed. Randomly it shows #REF! and then again not in tab "autorefresh-linked".

Actually before I click "Enable", I see #REF! and after that warning message  "The following external file could not be loaded. Data linked from this file did not get updated" when I click "Enable Content", I suddenly see linked data properly.

When repeatedly opened the file - I did not even need to click "Enable Content" - formulas worked even with linked data. But occasionally there are #REF! on sheet "autorefresh-linked".

At the same time "Tools->Options->LibreOffice Calc->General->Update links when opening->Always (from trusted locations)" was selected but did not have effect for  "Automatic update of external links has been disabled" message.
Comment 1 Edmund Laugasson 2018-10-20 21:25:56 UTC
Created attachment 145867 [details]
linked data autorefresh even works regardless of warning message

here on sheet "autorefresh-linked" the autorefreshing even works regardless of warning message "Automatic update of external links has been disabled" even from LibreOffice settings there is "Update links when opening" set to "Always (from trusted locations)"
Comment 2 Edmund Laugasson 2018-10-20 21:28:30 UTC
Created attachment 145868 [details]
here will be #REF! shown for linked data

Here you can see #REF! instead of proper output in sheet "autorefresh-linked". Still there is a warning message "Automatic update of external links has been disabled". Actually nothing has been disabled.
Comment 3 Edmund Laugasson 2018-10-20 21:29:25 UTC
Created attachment 145869 [details]
email formula that suppose to be

here is the email formula as it was entered into cell
Comment 4 Edmund Laugasson 2018-10-20 21:30:04 UTC
Created attachment 145870 [details]
email formula that has been overwritten

here you can see the overwritten email formula with absolute addresses
Comment 5 Edmund Laugasson 2018-10-20 21:30:51 UTC
Created attachment 145871 [details]
password formula that suppose to be

here you can see the password formula as entered into cell
Comment 6 Edmund Laugasson 2018-10-20 21:31:51 UTC
Created attachment 145872 [details]
password formula that has been overwritten

here you can see the overwritten password formula with absolute addresses
Comment 7 Edmund Laugasson 2018-10-20 21:35:52 UTC
There was 64-bit Linux Mint 19 used where user student has been created and these .ods files were in testing folder, so the full path for files were:
/home/student/testing/bug-link-to-external-data-better.ods
/home/student/testing/bug-link-to-external-data-worse.ods

Used VirtualBox 5.2.20 with appropriate extension pack installed + guest addition into virtual machine + all updates as of 20th october 2018 were also installed.
Comment 8 Edmund Laugasson 2018-10-20 21:36:33 UTC
... 64-bit Linux Mint 19 with MATE desktop....
Comment 9 Edmund Laugasson 2018-10-20 21:42:54 UTC
For LibreOffice there was an AppImage version (64-bit):
Version: 6.1.2.1
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk2; 
Locale: et-EE (et_EE.UTF-8); Calc: group threaded
user interface was in U.S. English.

Log was linked to https://hub.libreoffice.org/git-core/65905a128db06ba48db947242809d14d3f9a93fe and it opened the address https://gerrit.libreoffice.org/gitweb?p=core.git&a=log&h=65905a128db06ba48db947242809d14d3f9a93fe
Comment 10 Edmund Laugasson 2018-10-20 21:47:28 UTC
So, basically I started with bug-link-to-external-data-worse.ods file and made a copy of it to keep the initial file. While repeatedly opened that file (to check whether linked data works or not), there suddenly worked also that "autorefresh-linked" sheet. Then I renamed it to bug-link-to-external-data-better.ods and so I got two files with different state.
Comment 11 Edmund Laugasson 2018-10-20 21:58:59 UTC
For AppImage variant, the LibreOffice-fresh.full-x86_64.AppImage was used.
Comment 12 Buovjaga 2019-02-17 18:17:23 UTC
(In reply to Edmund Laugasson from comment #0)
> Steps to Reproduce:
> 1. create an .ods file with formulas that contain both linked and direct data
> 2. add name to range of cells both linked and direct data
> 3. add externally linked data to separate sheet both linked and direct data

These steps contain too many sub-steps to be quick & easy to repro. For example, I can't understand how in step 1 we can have linked data, while the linked data is added in step 3. Please give more detailed steps with minimal formulas. Everything with file names we will save to etc. Not like the massive email formula you attached.
Comment 13 Edmund Laugasson 2019-02-17 21:30:36 UTC
I gave prepared files with detailed explanation and this is the situation. This is not a comfortable bug but please see these files and you see the behaviour. Without seeing the files and knowing how to link the data, you will not understand the bug. When opening these files, you can see what data is manually entered and what is generated by formulas. Please see also named cells I am using.
Under preparing I mean by entering appropriate formulas. You can just copy the formulas in order to repeat the bug. These formulas just replace inappropriate symbols with appropriate one in e-mail addresses.
Please check my article with Google Translate - https://translate.google.com/translate?sl=et&tl=en&u=https%3A%2F%2Flibreoffice.ee%2Fautomaatne-varskendamine-calcis%2F - there is longer explanation with exact steps.
When repeating the issue, just copy my prepared data about characters and formulas as plain text to not copy possible buggy formatting. Repeat the autorefresh part only.
Comment 14 Buovjaga 2019-02-18 07:09:04 UTC
I know how to do all these things, but your steps not being exact enough is the reason none of our 20-30 triagers have touched this even though it has been 4 months.
Comment 15 Edmund Laugasson 2019-02-18 08:53:27 UTC
In my humble opinion I included as much information as possible (especially example files) to show the bug. Sorry - I am not a developer (programmer) but hopefully it is enough to see and fix the bug. As far as I tested with 6.2.0.3 version the bug still persist. I guess LibreOffice should be capable for more than just beginner level, for more serious formulas and calculations. Current bug is not a beginner level due to complexity of formulas. These formulas are compiled step-by-step as they are complex. As you claim to understand all the steps then I guess I do not need to create a separate document with step-by-step guidance. I was afraid that this will too long and then nobody reads it. I tried to be as short as possible and did not describe obvious steps like copy formula, etc. To avoid those sub-steps I prepared files: both .ods (ready-to-use) and .txt containing formulas that when reproducing would be easier to copy just formulas (not formatting), perhaps fix cell addresses if needed. These .ods files are much simplified from original files already.
Comment 16 Eike Rathke 2019-02-18 14:28:37 UTC
Can we have a *simple* example file please that does not involve such awkward lengthy formulas? Thanks.
Comment 17 Eike Rathke 2019-02-18 15:20:04 UTC
(In reply to Edmund Laugasson from comment #0)
> Actual Results:
> Formulas are overwritten with absolute path and therefore named cell range
> with linked data does not work anymore - formulas will be broken.
That observation is not correct. The formula *displays* the absolute path (as always for external URIs). Whether subsequently loading a file will take an absolute or a relative URI depends on the settings when saving the file, Tools -> Options -> Load/Save -> General, Save URLs relative to file system.

I don't understand even why you are trying to link an "external" file that is not an external file but the very same document and have each link reload every second. Doing so might ask for trouble, yes, though in general it should be handled generously. For referencing data in the same document on a different sheet simply use 3D references such as $Sheet1.A1 or named ranges, either global or sheet scope level.
Comment 18 Edmund Laugasson 2019-02-19 18:35:18 UTC
Sorry about complex formulas but these work and this is not the issue. If you look closer then I just solved the issue with random errors when people write names incorrectly, containing accidental non-relevant symbols. Also I solved an issue to generate strong passwords randomly. This table was necessary just to fix collected names and generate appropriate e-mail addresses with passwords for .csv file for users bulk creation. That file was born when two of the IT-managers from my community sent a request that can I solve such tasks with LibreOffice Calc like fix entered names with accidentally entered inappropriate symbols and generate usable e-mail addresses with strong passwords.
As I mentioned - this is not a simple, comfortable bug. Using one task with fixed names and generated e-mails, passwords for another task to offer an automatic refresh. As passwords are generated randomly then this was a good way to prove that auto refresh actually works when you see these values continuously renewing.

> That observation is not correct. The formula *displays* the absolute path (as always for external URIs).

Please see there are different files. One is working properly, another not (with #REF!)

> Whether subsequently loading a file will take an absolute or a relative URI depends on the settings when saving the file, Tools -> Options -> Load/Save -> General, Save URLs relative to file system.

This setting is relative by default. But links will appear with absolute path that will give #REF! values. Sounds like that setting is not working.

> I don't understand even why you are trying to link an "external" file that is not an external file but the very same document and have each link reload every second.

Could not find another way to automatically refresh table on another screen. There was requirement from my community to solve the issue and that is what I found.

> For referencing data in the same document on a different sheet simply use 3D references such as $Sheet1.A1 or named ranges, either global or sheet scope level.

That is done in first file (27.46 KB .ods) where autorefreshing works.

In that sense I am confused - why I am getting #REF! When to compare the files where autorefresh works and file where it does not work then formulas are same. If you claim this is not a bug but feature then I am totally confused.
Comment 19 Edmund Laugasson 2019-02-20 06:03:46 UTC
Current #120744 might be related with the bug #120736