Here is one of the LibreOffice options: Tools > Options > Load/Save > General > Save URLs relative to file system.
Most of the time we want this option to be enabled, because it provides us an opportunity to insert linked images with relative paths instead of absolute ones.
Typically, we would store the linked images close to the target document - in such a case, "Save URLs relative to file system" works fine. See below.
The problem with "Save URLs relative to file system" option is that it works the same way for linked **templates**.
The templates - in contrast with images - are typically stored in the special "Templates" directory. On Windows, it will be %AppData%\LibreOffice\4\user\template. They don't "travel" with the document.
Hence, when you have "Save URLs relative to file system" option is enabled, and then you create a document with a template linked to it, and then you save and close it, and then you move it to another disk drive (e.g., to the disk D), the document will stop to notice any changes in the template it is linked to.
Step by step guide:
0. Ensure "Save URLs relative to file system" option is enabled.
1. Create a custom template and save it to %AppData%\LibreOffice\4\user\template. (It is assuming that this directory is located on the disk C.)
2. Create a document based on this template. Save it do disk C. Ensure the template is linked to it.
3. Close it. Move it to disk D.
4. Open the template and make some changes in its styles. Of course, save it and close it.
5. Open the moved document and notice that there is no prompt to update the styles.
Steps to Reproduce:
User Profile Reset: Yes
How it should be fixed:
The linked templates should always use absolute paths; not relative ones. That is, "Save URLs relative to file system" should not affect how they are linked.
> Open the moved document and notice that there is no prompt to update the styles.
Version: 220.127.116.11.alpha0+ (x64)
Build ID: 54d3760f7dbd759cc8de6c777c6a2154d2382f16
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win;
Locale: de-DE (de_DE); UI-Language: en-US
LO user Profile:
meta.xml, document saved to
a) same drive:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="HelloTest" xlink:href="../user/template/HelloTest.ott" meta:date="2020-03-28T11:15:37.978000000"/>
b) different drive:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="HelloTest" xlink:href="file:///D:/sources/libo-core/instdir/user/template/HelloTest.ott" meta:date="2020-03-28T11:11:49.175000000"/>
After a template styles update there is no info about changed styles in case a) if the document has been moved to a different path. In case b) a message box pops up:
"The template 'HelloTest' on which this document is based, has been modified. Do you want to update style based formatting according to the modified template?"
btw: I remember there was a template changer extension available:
I think there should be a configuration option to let the user know that the document template is not available. In this case, you should be able to reassign the template.
> I think there should be a configuration option to let the user know
> that the document template is not available.
Yes, I think it is good idea. It could be considered as a temporary solution until LO will be able to handle it in a more elegant way.
Deprecated. One should use DocumentTemplateChanger instead.