Created attachment 109182 [details] Error message when opening relative link I want to use relative links in Writer (open and save them between LibreOffice and MS Word). I have enabled the option Load/Save -> General -> Save URLs relative to filesystem. If I insert a link to an external file in the same directory, it is saved as an absolute link (full path). If I create a document in MS Office 2010, and insert a relative link, LibreOffice Writer can't open it, but MS Office can (see attached screenshot). I have tried this with PNG and XLS external files in the same directory.
Just updated to version 4.2.6.3, same issue.
PLease explain step by step what you do to reproduce the problem, especially how you insert a relative link. And attach your test document. Best regards. JBF
Created attachment 109192 [details] test documents with absolute and relative links in LibreOffice and MS Office
(In reply to Jean-Baptiste Faure from comment #2) > PLease explain step by step what you do to reproduce the problem, especially > how you insert a relative link. And attach your test document. 1. Start with a brand new configuration for LibreOffice in Linux: mkdir ~/bak mv ~/.libreoffice ~/libreoffice ~/bak mv ~/.config/libreoffice ~/bak/config 2. Create a "test" directory: mkdir ~/test cd ~/test 3. Create a pair of files to link in the document: echo relative > relative.txt echo absolute > absolute.txt 4. Verify that my distribution didn't create some strange shellscript wrapper (I already know this because I checked how the package was created): bash$ ls -l /usr/bin/soffice lrwxrwxrwx 1 root root 36 Nov 10 12:20 /usr/bin/soffice -> /usr/lib/libreoffice/program/soffice bash$ md5sum /usr/lib/libreoffice/program/soffice ec0d407981b993c828024639cefebda7 /usr/lib/libreoffice/program/soffice bash$ head /usr/lib/libreoffice/program/soffice #!/bin/sh # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license notice: # 5. Start LibreOffice Writer by running in bash: soffice 6. Verify settings in Tools / Options / Load/Save / General. Save URLs relative to file system is checked by default. 7. Click on "Writer Document" to create a Writer document. 8. Insert a link (CTRL-K) 9. Click on "Document" to insert a link to a local file, rather than an Internet link 10. Type in the "Document Path" field: relative.txt 11. Click [Apply] 12. A link is created: text: "relative.txt" tooltip: "Control-Click to follow link: relative.txt" 13. Hit <enter> to insert newlines a couple of times, and then a new link (CTRL-K) 14. Click on the Filesystem browser icon, next to the "Document Path" field. 15. Browse the filesystem to select ~/test/absolute.txt 16. Click [Apply] 17. A link is created: text: "/home/alan/test/absolute.txt" tooltip: "Control-Click to follow link: file:///home/alan/test/absolute.txt" 18. Current situation: a. the document has not been saved b. the current working directory of soffice is /home/alan/test: bash$ pgrep -a soffice 1222 /usr/lib/libreoffice/program/soffice.bin --splash-pipe=5 bash$ ls -l /proc/1222/cwd lrwxrwxrwx 1 alan users 0 Nov 10 16:00 /proc/1222/cwd -> /home/alan/test 19. Control-Click the first link (relative.txt). You will get an error message. 20. Control-Click the second link (/home/alan/test/absolute.txt). The file will open with an external program. 21. Save (CTRL-S) 22. In the file-save dialog, browse to ~/test and save as test-lo.docx 23. A new window pops, saying: This document may contain formatting or content that cannot be saved in the currently selected file format "Microsoft Word 2007/2010/2013 XML". Use the default ODF file format to be sure that the document is saved correctly. [x] Ask when not saving in ODF format [Use Microsoft Word 2007/2010/2013 XML Format] [Use ODF Format] 24. Click on "Use Microsoft Word 2007/2010/2013 XML Format" 25. Close LibreOffice Writer 26. Go to a Windows computer with MS Office 2010 27. Create a new directory: c:\temp\test 28. Copy the ~/test directory from the Linux computer to Windows, under c:\temp 29. Go to c:\temp\test, double click test-lo.docx, it opens in MS Word 2010, the title bar shows: test-lo.docx [Compatibility Mode]. The document in MS Word shows the text "/tmp/test.txt", the popup shows: file:///\\tmp\test.txt Ctrl+Click to follow link 30. Move the pointer over the text. There is no popup for the first text (relative.txt), but there is a popup for the second one (/home/alan/test/absolute.txt). The first text is not even a link. The link was lost when LibreOffice saved the file. 31. Press Ctrl while clicking the absolute link, an error message shows up saying: Cannot open the specified file. This is expected. 32. Click on File / Close to close the current document 33. Click on File / New / Blank document to create a new document 34. Click on Insert / Hyperlink 35. Type "relative.txt" in the Address field. 36. A link is created: text: "relative.txt" tooltip: "Control-Click to follow link: relative.txt" 37. Hit enter to insert a newline, and then click on Insert / Hyperlink 38. Click on the Filesystem browser icon, next to the "Document Path" field. 39. Browse the filesystem to select c:\temp\test\absolute.txt 40. Click [OK] 41. A link is created: text: "C:\temp\test\absolute.txt" tooltip: "Ctrl-Click to follow link: file:///c:\temp\test\absolute.txt" 42. Current situation: a. the document has not been saved b. the current working directory of MS Office is unknown 43. Control-click the first link (relative.txt). You will get an error message. 44. Control-click the second link (c:\temp\test\absolute.txt). After a warning dialog, the file will open with an external program. 45. Save (CTRL-S) 46. Type "c:\temp\test\test-ms.docx" and click [Save] 47. Control-click the first link again (relative.txt). This time it opens. 48. Close MS Word 49. Copy test-ms.docx saved by MS Word with the relative link to the Linux computer, to ~/test/ 50. Open test-ms.docx with LibreOffice 51. Control-Click the first link (relative.txt). You will get an error message (this is an error). 52. Control-Click the first link (c:\temp\test\absolute.txt). You will get an error message (this is expected).
Thank you for your answer. Setting back to unconfirmed. Can't test your scenario myself because I do not have MS-Windows. Best regards. JBF
(In reply to Jean-Baptiste Faure from comment #5) > Thank you for your answer. Setting back to unconfirmed. Can't test your > scenario myself because I do not have MS-Windows. Reproducing this bug doesn't require Windows. This bug report could be divided in two: 1. LibreOffice in Linux can't create a document with relative links. 2. LibreOffice in Linux can't open relative links. Since I can't create a document with relative links in LibreOffice in Linux, I had to use MS Office to create one, and then prove the second bug. You don't need Windows to reproduce the first bug, and you don't need Windows to reproduce the second bug since I have attached a document with relative links created by MS Office.
Hi lameventanas, (In reply to lameventanas from comment #6) > 1. LibreOffice in Linux can't create a document with relative links. > 2. LibreOffice in Linux can't open relative links. This simply works for me on Ubuntu with 4.2.x .. 4.4.x (and in the past too, from what I know)..
I have the same problem - relative links to files does not work. == General Info OS: Both on Linux and Win7. LibreOffice: Version: 4.3.5.2 == Steps See new attachment "test_relative_path.rar" which contains the example. 1) Extract all contents of archive in any location 2) Open "test_out.docx" with LibreOffice 3) Click "Relative File Link" in the document 4) File "linked.docx" that resides in "test_out_files" directory is not oppened. It is considered to be an absolute path, though it is of relative form == Additional info MS Office handles this relative link and file "linked.docx" is opened. The link contains this text: {HYPERLINK "test_out_files/linked.docx"} We generate .doxc documents automatically and what we are trying to achieve is that if 1st user generates document + document's resources in subfolder and sends all the files to 2nd user, then 2nd user could navigate to the resource files on their machine.
Created attachment 111177 [details] Archive contains linked documents using a relative path
(In reply to eeedgaras from comment #8) > == Steps > See new attachment "test_relative_path.rar" which contains the example. > 1) Extract all contents of archive in any location > 2) Open "test_out.docx" with LibreOffice > 3) Click "Relative File Link" in the document > 4) File "linked.docx" that resides in "test_out_files" directory is not > oppened. It is considered to be an absolute path, though it is of relative > form Reproduced. Not working on 3.3.0 either, launched from soffice.sh: sh: 1: test_out_files/linked.docx: not found Ubuntu 14.10 64-bit Version: 4.5.0.0.alpha0+ Build ID: 7201fa0dddd7dd0352f69fd2b2b64efcb361ccad TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-01-11_23:28:55 LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4 Win 7 64-bit Version: 4.5.0.0.alpha0+ Build ID: b3b4bbaf6cbd2226b659fea7d6ae473ccf84e9dd TinderBox: Win-x86@39, Branch:master, Time: 2015-01-12_06:13:44
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.4 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT: - Update the version field - Reply via email (please reply directly on the bug tracker) - Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2016-01-17
Bug is still present in 5.1.2.2.0 and it does not work with images too.
So this is apparently a problem with docx (and probably similar formats) only, not with odt.
<https://cgit.freedesktop.org/libreoffice/core/commit/?id=0dd82f4ffe7ae462bae30b93d245d2234c55ef84> "tdf#86087: Convert relative URLs to absolute upon import of docx etc." fixes the import part of the issue.
(In reply to Stephan Bergmann from comment #13) > So this is apparently a problem with docx (and probably similar formats) > only, not with odt. No, this's a problem with ODT also. This also effect HTML exports. The HTML cannot refer relative links. Documents getting bigger. Save times increasing...
(In reply to Stephan Bergmann from comment #14) > <https://cgit.freedesktop.org/libreoffice/core/commit/ > ?id=0dd82f4ffe7ae462bae30b93d245d2234c55ef84> "tdf#86087: Convert relative > URLs to absolute upon import of docx etc." fixes the import part of the > issue. This has to be reverted back! This's a bug in itself! LO must support relative links.
(In reply to dE from comment #15) > (In reply to Stephan Bergmann from comment #13) > > So this is apparently a problem with docx (and probably similar formats) > > only, not with odt. > > No, this's a problem with ODT also. This also effect HTML exports. The HTML > cannot refer relative links. > > Documents getting bigger. Save times increasing... No idea what your exact problem with HTML export is. Please file a new bug (and mention its ID here) clearly stating the exact problem with HTML export.
(In reply to dE from comment #16) > (In reply to Stephan Bergmann from comment #14) > > <https://cgit.freedesktop.org/libreoffice/core/commit/ > > ?id=0dd82f4ffe7ae462bae30b93d245d2234c55ef84> "tdf#86087: Convert relative > > URLs to absolute upon import of docx etc." fixes the import part of the > > issue. > > This has to be reverted back! This's a bug in itself! LO must support > relative links. What exactly is it that stopped working with that commit? Please be precise.
Szymon Kłos committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4b9e237850efe36f7e35d65e14d6953f1e1f3a45 tdf#86087 Open relative links in Writer It will be available in 6.0.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.
Szymon Kłos committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=40acf8d6447065077acba9e800c56239f58c8262 tdf#86087 DOCX Import link as relative if preferred It will be available in 6.0.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.
Szymon Kłos committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2b2f1352c72280dd25ed3bef090a3c708ee4b964 tdf#86087 Save relative links in DOCX It will be available in 6.0.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.
Szymon Kłos committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=30af6599d59067a8da6dc4075e80069e80e25f09 tdf#86087 don't decode links It will be available in 6.0.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.
Szymon Kłos committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd51f01dbca1ddebe846ec9f56cbb13002f295c6 tdf#86087 fix relative link open on linux It will be available in 6.0.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.