Bug 117261 - External Forms: Form control property connection-resource link-ref contents changed when an odt file is saved
Summary: External Forms: Form control property connection-resource link-ref contents c...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Stahl
URL:
Whiteboard: odf target:6.2.0 target:6.0.6 target:...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2018-04-26 19:07 UTC by robert
Modified: 2018-07-09 10:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Unzip the attached Zip. Open the external form. Rest: See bugdescription. (18.25 KB, application/zip)
2018-04-26 19:07 UTC, robert
Details
tail of output in bibisect-linux-64-5.3 (2.98 KB, text/plain)
2018-05-07 01:53 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2018-04-26 19:07:11 UTC
Created attachment 141661 [details]
Unzip the attached Zip. Open the external form. Rest: See bugdescription.

- Unzip the attached folder. It contains a database and a external Writer-form.
- Open the Writer-form.
- Change some data, goto next row. Data will be saved.
- Close the form. You will be asked if you wish to save your document. You haven't changed anything, what should be save, butt press "Save".
Form will be closed.
- Reopen the form.
The connection to the database will be lost.

This bug appears first here with LO 5.3.0.3 on OpenSUSE 42.3 64bit rpm Linux. Works without destroying the connection to the database in LO 5.2.5.1 (last installed version from LO 5.2 here).
This buggy behavior could be reproduced also with LO 5.4.6.2 and LO 6.0.4.1.
Comment 1 Drew Jensen 2018-04-26 20:31:34 UTC
can confirm this using:
Version: 5.4.6.2
Build ID: 1:5.4.6-0ubuntu0.17.10.1
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group

After unzipping the example files opening content.xml inside TestAufnahme.odt you will find the form control with the following:
<form:connection-resource xlink:href="file:///home/robby/Downloads/TestDB/TestDB.odb"/>

Now I fix that for my directory path and the form functions as needed.

Save the form and close it.

Looking at contents.xml the value has changed to:

<form:connection-resource xlink:href="../TestDB.odb"

relative addressing does not work there, not sure id ever did but maybe.

If you register the odb and use the registered name it all works fine of course, but that isn't the point is it.

I know idea why the odt file is being set to dirty when a post data happens. If I check with the form properties right after that the fully qualified path name is still present.
Comment 2 Drew Jensen 2018-04-26 20:38:57 UTC
Also. If relative addressing were working the path ../TestDB.odb is still an error, the actual path to the file is ./TestDB.odb or TestDB.odb neither of with the form control accepted when I tried them.
Comment 3 Terrence Enger 2018-05-07 01:53:58 UTC
Created attachment 141944 [details]
tail of output in bibisect-linux-64-5.3

Working on debian-buster in bibisect-linux-64-5.3, I see that the
connection to the database upon save/close/open started failing with:

    commit fbb3b60cdb7a22595eec80232bb3ccd83781cf00
    Author: Michael Stahl <mstahl@redhat.com>
    Date:   Tue Jul 19 14:58:09 2016 +0200

        xmloff: forms export: convert one xlink:href to relative
    
        Mostly in forms directory the URLs are converted to relative via
        exportRelativeTargetLocation(), but not in this one case on the
        form:connection-resource element.  Let's make this consistent.
    
        Change-Id: I9252d2686d04c273261b95966a5cf4e9bcbc0bca

I am adding Michael Stahl to cc and setting keyword bisected.
Comment 4 Xisco Faulí 2018-06-05 18:52:09 UTC
Adding Cc: to Michael Stahl
Comment 5 Michael Stahl 2018-07-06 15:36:04 UTC
yeah sorry that was dumb of me, i must have forgotten to change the import accordingly to convert the URL to absolute again.

fortunately this can be fixed in a way that the existing files will import properly in the fixed version.
Comment 6 Commit Notification 2018-07-06 19:26:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=510209df4bcf457cac819e75889d564d620f119d

tdf#117261 xmloff: ODF import: convert form:connection-resource URL

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-07-06 22:24:42 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2bd85bfd98203cc11e2391e01e9f8d70a9037214&h=libreoffice-6-0

tdf#117261 xmloff: ODF import: convert form:connection-resource URL

It will be available in 6.0.6.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2018-07-06 22:24:53 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=89183e6e5bf2f6fdd96418d9007f39d5757647d1&h=libreoffice-6-1

tdf#117261 xmloff: ODF import: convert form:connection-resource URL

It will be available in 6.1.0.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Xisco Faulí 2018-07-09 10:51:14 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 67f3063b7c334d4d5c59132d90b938671aad09f0
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

@Michael Stahl, Thanks for fixing this!!