Bug 135108 - Err:540 when adding an external reference in a loaded document that so far had no linked externals
Summary: Err:540 when adding an external reference in a loaded document that so far ha...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.4.2 release
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.1.0 target:7.0.4
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-24 16:44 UTC by TorrAB
Modified: 2020-11-03 09:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
file from which to copy (9.58 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-07-24 17:44 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-07-24 16:44:05 UTC
Description:
	Step0: Open refSource.ods, or any *.ods file.
	Step1: open a new file, where you select cell A2; enter ‘=’ and click any cell in refSource, eg, B1, to copy it; get Err:540. To fix this,
	Step2: click Edit>links, click Update; error persists.
	Step3: Close new file as refCopy, and reopen it.
	Click ‘Allow updating’; error disappears, at last. But, why was Step3 necessary? Step2 should suffice. In fact, why should the error occur at all?


Steps to Reproduce:
	Step0: Open refSource.ods, or any *.ods file.
	Step1: open a new file, where you select cell A2; enter ‘=’ and click any cell in refSource, eg, B1, to copy it; get Err:540. To fix this,
	Step2: click Edit>links, click Update; error persists.
	Step3: Close new file as refCopy, and reopen it.
	Click ‘Allow updating’; error disappears, at last.

Actual Results:
error persists even after links updated

Expected Results:
Error should not occur if source is valid.


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 TorrAB 2020-07-24 17:44:40 UTC
Created attachment 163488 [details]
file from which to copy
Comment 2 Eike Rathke 2020-10-27 00:08:30 UTC
Can't reproduce, neither 6.4.7 nor 6.4.0, with setting Update links when opening "On request" under Tools -> Options -> Calc -> General.
Comment 3 TorrAB 2020-10-29 02:02:48 UTC
(In reply to Eike Rathke from comment #2)
> Can't reproduce, neither 6.4.7 nor 6.4.0, with setting Update links when
> opening "On request" under Tools -> Options -> Calc -> General.

Like you, I have Update links when opening "On request"
And I reproduced steps 1…3 as described, with LO 7.0.1.2(x64).
What do you mean by ‘neither 6.4.7 nor 6.4.0’?
In your test, does the error occur? If yes, how do you remove it?
Comment 4 Eike Rathke 2020-10-29 14:49:52 UTC
That means I tried in both 6.4.0 and 6.4.7 and could not reproduce the error.
Comment 5 TorrAB 2020-10-29 22:39:20 UTC
(In reply to Eike Rathke from comment #4)
> That means I tried in both 6.4.0 and 6.4.7 and could not reproduce the error.

Versions 6.4.0 and 6.4.7?
Since I use LO 7.0.1.2(x64), it seems the bug was introduced recently
Comment 6 TorrAB 2020-10-29 23:12:21 UTC
The error occurs with a new file.
With an existing file (reloaded), Step1 does an immediate copy, without Err:540.
Comment 7 Eike Rathke 2020-10-30 12:57:24 UTC
(In reply to TorrAB from comment #5)
> Versions 6.4.0 and 6.4.7?
> Since I use LO 7.0.1.2(x64), it seems the bug was introduced recently
The Version field of this bug is set to 6.4.4.2, hence I tried those.
Comment 8 Eike Rathke 2020-10-31 23:20:30 UTC
Using 7.0.1.2 I still can not reproduce.
Comment 9 Eike Rathke 2020-11-01 00:50:27 UTC
Maybe I misunderstood "open a new file", that for me meant a new document, not loading another document.

However, not trying to link from a new document, but from another loaded document that so far has no external links and thus no "Allow updating" notification I do get an Err:540 in 7.0.1 and also in 6.4.7 but not in 6.4.0

It appears that a security measure not allowing external links is not reset in this situation.
Comment 10 Commit Notification 2020-11-01 19:40:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/14f9dac4fbaeb0e13ad4875f77960c4019d8f229

Resolves: tdf#135108 Allow link updates if loaded document so far had none

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Eike Rathke 2020-11-01 19:40:56 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/105055 for 7-0
Comment 12 Commit Notification 2020-11-03 09:39:44 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/486034a22860e8db1ef5ea4ee258d3fe0395886d

Resolves: tdf#135108 Allow link updates if loaded document so far had none

It will be available in 7.0.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.