Bug 131392 - Introduce option to "Save URLs relative to file system" for templates
Summary: Introduce option to "Save URLs relative to file system" for templates
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 131619 (view as bug list)
Depends on:
Blocks: Templates
  Show dependency treegraph
 
Reported: 2020-03-17 23:01 UTC by John
Modified: 2024-07-09 17:04 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2020-03-17 23:01:55 UTC
Description:
```
C:\Program Files\LibreOffice
%AppData%\LibreOffice\4\user\template\template.ott
C:\Users\John\Desktop\test.odt
```

4. Make changes in the template.

5. Move test.odt to another drive (I have two logical drives: C and D. Most of my non-system files are on D). Open it. There will be no prompt to update the styles. This is bad.

* * *

Most of the time we use "Save URLs relative to file system" option for linked images, which are typically located in the "images" directory "near" the document itself. This is convenient.

However, it shouldn't affect the linked template because such behavior makes zero sense for real work. At least, for most real-life use-cases.

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: Yes



Additional Info:
-
Comment 1 John 2020-03-17 23:05:14 UTC
SORRY. THE COMPLETE TEXT:

1. Disable: Tools > Options > Load/Save > General > Save URLs relative to file system.

2. It is assumed you have a template in Templates dir.

3. Create a document based on this template. Save it to Desktop. In my case, the locations looks as following:

```
C:\Program Files\LibreOffice
%AppData%\LibreOffice\4\user\template\template.ott
C:\Users\John\Desktop\test.odt
```

4. Make changes in the template.

5. Move test.odt to another drive (I have two logical drives: C and D. Most of my non-system files are on D). Open it. There will be no prompt to update the styles. This is bad.

* * *

Most of the time we use "Save URLs relative to file system" option for linked images, which are typically located in the "images" directory "near" the document itself. This is convenient.

However, it shouldn't affect the linked template because such behavior makes zero sense for real work. At least, for most real-life use-cases.
Comment 2 Buovjaga 2020-07-20 14:58:54 UTC
Adding UX team for comments as this would affect fundamental functionality.
Comment 3 Heiko Tietze 2020-07-21 10:30:35 UTC
The link is relative, see meta.xml xlink:href="../Test.ott". And while you sometimes move both document and template to another location it's also likely to just move the document.

We have many tickets regarding this functionality such as bug 61743, bug 86785, bug 104674 or bug 131619. And see also bug 111957.

To sum up, whatever solution we take it fails the other way. And as a user I'd expect the application to search for missing links like "Template Foo.ott not found. [Pick manually] [Search files] [Cancel]".

PS: Please consider to update. "Still" version is 6.3, "Fresh" v7 will be published soon. Though this will not affect the issue.
Comment 4 Heiko Tietze 2020-07-30 14:27:10 UTC
We discussed the request in the design meeting.

   + templates usually remain on the same place; there is Tools > Options > Load/Save >
     General > URLs relative to file system to switch between relative and 
     absolute path (Sascha)
   + sharing documents with other users requires relative path and templates at 
     a safe place (Sascha)
   + would be nice to show this setting (or be able to change on the fly) 
     while saving (Sascha)
   + decide whether relative or not per input of full path?
     + bad solution as barely discoverable (Heiko)
     + very uncommon as path is specified above (Krunoslav)
   + expert option, feedback not urgently needed (Patrick)


In a nutshell: You can change whether URLs are absolute or relative per Tools > Options > Load/Save > General. Admittedly there is no help (changing the component to ping the documentation team, but still WF).

https://help.libreoffice.org/6.4/en-US/text/shared/optionen/01020000.html?&DbPAR=WRITER&System=UNIX
Comment 5 Mike Kaganski 2020-07-30 14:28:02 UTC
I don't see a use case when a template should be searched relative to opened document. If it's edited locally, it's OK to use absolute path to the template (e.g., in user's profile); if passed to another user, it doesn't make sense to use relative addressing in this case, because likely the document will not be in the same position relative to that user's profile; is working on a shared project with shared templates, using absolute path to the shared template is also OK.

So what is the use case to have an option to save paths to templates relative? Sending files along with their templates? how important that use case is? i.e., why would in such a workflow edits to templates be necessary, which is the reason to find the templates relative to the documents?
Comment 6 S.Zosgornik 2020-07-30 21:33:39 UTC
> So what is the use case to have an option to save paths to templates
> relative? Sending files along with their templates? how important that use
> case is? i.e., why would in such a workflow edits to templates be necessary,
> which is the reason to find the templates relative to the documents?

The only use case for sharing templates with other users I can imagine is when several persons remotely work on the same document-set without sharing one remote folder. This use case might be small but can practical happen.

You sent a folder full of documents to a college or friend and include the templates within the folder for further editing.

Personally do I not mind this feature but I am sure the use case can happen.
Comment 7 Mike Kaganski 2020-07-30 22:03:15 UTC
(In reply to Sascha Z from comment #6)

So practically the decision was this:

We agree that for majority of practical uses of linked templates (with the exception of the same case that I and Sascha Z both described, and agreed that it should be not frequent, and even further, neither me nor Sascha Z use in practice, and only speculate about its possibility), the absolute paths are needed, and this need prevents users from using relative linking for all other useful reasons in their documents. Thus majority of users who rely on linked templates cannot presently use the relative linking in their documents, because that negatively affects their linked templates

Yet we close a bug that asks to change the linking of templates to absolute, on which grounds? that those users can configure their linking (as said, this way disabling themselves from using relative linking in their documents).

Have I missed something?

Current "resolution" makes 100% of users of linked templates unhappy. Both groups - the discussed majority, and the minority, both need to configure their linking according to the needs of templates, and then be unable to use the other way for other uses in document (like linked images); or use the linking mode needed for their contents (images), sacrificing the linked templates.

The proposal asked to make the major group happy allowing them to use linked templates, and independent mode for their images; while keeping minority unhappy.

The ideal solution could be a separate configuration, also discussed.

I honestly cannot see the reason of this "WF".
Comment 8 Heiko Tietze 2020-07-31 12:42:05 UTC
(In reply to Mike Kaganski from comment #7)
> I honestly cannot see the reason of this "WF".

One request versus many users complaining about regression once we changed the default. Feel free to reopen, if you think it should be done.
Comment 9 Mike Kaganski 2020-07-31 12:52:22 UTC
(In reply to Heiko Tietze from comment #8)
> One request versus many users complaining about regression **once we changed
> the default**.

I read that "changed the default", and start to suspect that there's some misunderstanding here - Heiko, do you see that the request is *not* about any defaults? The request is to make export of template path *independent* of the setting that you likely think about - i.e., the request is not to change the default value on Options->Load/Save->General, but to not use that setting (default value of which is not the topic here) for writing specific thing to file?
Comment 10 Heiko Tietze 2020-07-31 15:05:49 UTC
(In reply to Mike Kaganski from comment #9)
> The request is to make export of template path *independent*

That would improve the situation a bit. But still you have to go to T>O to change it.
Comment 11 Mike Kaganski 2020-07-31 15:15:32 UTC
(In reply to Heiko Tietze from comment #10)
> But still you have to go to T>O to change it.

Is "T>0" something everyone should know what it means?
Comment 12 Heiko Tietze 2020-07-31 15:26:47 UTC
(In reply to Mike Kaganski from comment #11)
> (In reply to Heiko Tietze from comment #10)
> > But still you have to go to T>O to change it.
> 
> Is "T>0" something everyone should know what it means?

Short for Tools > Options. Point is you have to go into the options dialog every time you want to change whether the template should use relative or absolute path. And the discussion was also to make this easier, which I still think is not a very common use case- so rather not. Nothing to say against individual settings for documents and templates. John, as the one who filed the enhancement request, would you benefit from this and also find the option?
Comment 13 Mike Kaganski 2020-07-31 15:32:27 UTC
(In reply to Heiko Tietze from comment #12)
> Short for Tools > Options. Point is you have to go into the options dialog
> every time you want to change whether the template should use relative or
> absolute path. And the discussion was also to make this easier, which I
> still think is not a very common use case- so rather not. Nothing to say
> against individual settings for documents and templates. John, as the one
> who filed the enhancement request, would you benefit from this and also find
> the option?

OMG. The ticket is to *remove* configurability from templates relativity, or to add a separate configure for it; OP had never told that configuration is too difficult; OP knew where to configure the existing functionality; the argument of OP was that relativity of templates in documents should not depend on relativity of other linked stuff.

It is some sport to discuss something unrelated, and close tickets on the grounds that people dislike that something unrelated?
Comment 14 Heiko Tietze 2020-08-03 08:07:54 UTC
Had a long discussion with Mike and he convinced me to reopen the ticket. Let's introduce another "URL relative" option for templates.
Comment 15 John 2020-10-28 14:18:56 UTC
As I said earlier, I have two drives: C and D. Desktop and AppData are on C.

Tests:



Test 1
Save URLs relative to file system = True

meta.xml in saved_on_desktop.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="../../AppData/Roaming/LibreOffice/4/user/template/template.ott"

meta.xml in saved_on_drive_d.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///C:/Users/John/AppData/Roaming/LibreOffice/4/user/template/template.ott"



Test 2
Save URLs relative to file system = False

meta.xml in saved_on_desktop.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///C:/Users/John/AppData/Roaming/LibreOffice/4/user/template/template.ott"

meta.xml in saved_on_drive_d.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///C:/Users/John/AppData/Roaming/LibreOffice/4/user/template/template.ott"



I do not understand it.

Even worse, if you have both

* file:///C:/Users/JphnAppData/Roaming/LibreOffice/4/user/template/template.ott
* file:///D:/my_stuff/libreoffice/template.ott

and you have created a document from the second template (i.e., from file:///D:/my_stuff/libreoffice/template.ott) (by double-clicking it in file manager), the results will be as follows:



Test 1a:
Save URLs relative to file system = True

meta.xml in saved_on_desktop.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///D:/my_stuff/libreoffice/template.ott"

meta.xml in saved_on_drive_d.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="../my_stuff/libreoffice/template.ott"



Test 2a:
Save URLs relative to file system = False

meta.xml in saved_on_desktop.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///D:/my_stuff/libreoffice/template.ott"

meta.xml in saved_on_drive_d.odt:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="template" xlink:href="file:///D:/my_stuff/libreoffice/template.ott"



This is crazy.
Comment 16 John 2020-10-28 14:33:48 UTC
This probably should be posted as a separate issue.
Comment 17 John 2020-10-28 19:37:21 UTC
(In reply to John from comment #15)
> I do not understand it

Actually, I _do_ understand. I just was very pissed off. What I _really_ wanted to say is that:

1. Most people (including myself) have "Save URLs relative to file system" option enabled. This is OK. Some people disable it. This is OK too.

2. At least for the first group of users, the current way of how the inheriting works, leads, in some cases, to unexpected and unwanted things.

For example, you saved a document to your desktop on drive C, then you moved it on drive D, and from this point, the program stops to notify you about inconsistencies between a template and a document based on it.

It is obvious that in 99% cases we want the absolute path to the template -- regardless of whether "Save URLs relative to file system" option is enabled (which is the default and my personal preference) or disabled.

> This is crazy.

What I _really_ wanted to say is that this is an additional pitfall for a user. I think it should be fixed in one of the following ways:

a) When you create a document from a template by double-clicking it in file manager, the inheriting should be the same as in the case when you create a document from this template using File > New > Templates.

b) Or, when you double click a template in file manager and template is opened, there should be a message that you should not use it in such a way. The message should inform the user that it is much safer to copy this template into the directory specified in Tools > Option > LibreOffice > Paths > Templates, and then used using File > New > Templates

c) Or, such a use should be somehow disabled.
Comment 18 John 2020-10-28 19:40:32 UTC
So there are 2 issues. I tried to explain both.
Comment 19 John 2021-10-06 15:25:51 UTC
It is assumed LibreOffice is installed on drive C, the LibreOffice user profile is also on drive C, and you also have drive D. And you have a custom template in your LibreOffice user profile; this template is used for all of your documents.

In my LibreOffice 7.1.5.2, this works in the following way currently:

If Save URLs relative to file system = True
-------------------------------------------

**Test 1, step 1:** If you create a document, save on drive C, then change the template, and then open that document again, you **will be** prompted to update its styles. This is fine.

**Test 1, step 2:** Then, if you move this file to drive D and open it from there, you **won't** be prompted to update styles. I think this is a bug/issue.

**Test 2, step 1:** If you create a document, save it on **drive D**, then change the template, and then open that document again, you **will be** prompted to update its styles. This is fine.

**Test 2, step 2:** Then, if you move this file to **drive C** and open it from there, you **will be** be prompted to update styles. This is fine.

So, if "Save URLs relative to file system" is "True", LibreOffice forgot to ask user to update styles only on the 2nd step of the 1st test.

If Save URLs relative to file system = False
--------------------------------------------

TODO. I'm too tired now.
Comment 20 Stéphane Guillou (stragu) 2024-01-29 08:10:40 UTC
*** Bug 131619 has been marked as a duplicate of this bug. ***