Bug 165536 - WRITER / handling templates -- you must import it
Summary: WRITER / handling templates -- you must import it
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-02 16:53 UTC by peter josvai
Modified: 2025-12-04 03:18 UTC (History)
1 user (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 peter josvai 2025-03-02 16:53:51 UTC
Description:
hi, 

I have had this several times, but always thought it was just an accidental incident, I mean, it couldn't be repeated, I thought.

ANYWAY: 

You close Libreoffice. Exit.
Go to the directory where your templates reside.
Find your favorite one, and copy and paste it there, under a different name. Say, my_fav_template_25.ott (from my_fav_tempalte_24.ott).

You do this and it just doesn't work... 

- - -

I don't want to import it. Cause I would have to place it somewhere else, from where I could import it.  If you import it from your template directory, it will have a different name.... Don't ask :) 
This should just work. But it doesn't. I have restarted my machine, still no success. The new template doesn't appear in the list.

Steps to Reproduce:
1. exit libreoffice 
2. go to the template directory (find it in Tools/ Options / paths)
3. pic a template and copy-paste it under a different name

Actual Results:
The new template doesn't show up in the template list.

Expected Results:
The new template should show up in the template list.


Reproducible: Always


User Profile Reset: No

Additional Info:



[Information automatically included from LibreOffice]
Locale: en-US
Module: StartModule
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 peter josvai 2025-03-02 17:47:23 UTC
additional experiments:

#1
on another machine which shares the same template directory with this machine (through cloud syncing), I found the new template!

However, it's not how it is supposed to be :) 

"my_temp_25" wasn't there.. but I opened "temp_25" for editing, and it turned out to be "temp_25.ott" ...

- - -

#2
On this (original machine) I right click (in a  file manager) on my_temp_25.ott
and... a new document (untitled) opens.... 
and I check what template it is based on, and it's... 
my_temp_24 :) 


Now it's beginning to make sense!

the problem "is" that within that template a template name is being recorded, I mean hardcoded... written in it... 



I sense that this is a VERY COMPLEX system... 
including handling documents whose template is not available on that machine... 
etc, etc.. I guess there must be a dozen scenarios... 
not to mention old stories... 

STILL...
copy-pasting a template under a new name in the template director should work...
Comment 2 peter josvai 2025-03-02 18:02:44 UTC
hi!

new "developments"!! :) 

(I know this is only new to me :))

So, I extracted that my_temp_25.ott

and opened (in a text editor) the meta.xml

and it has info in it...

especially within one "tag": <dc:title>

and it had the value: "my_temp_24"

...........
I have corrected it to my_temp_25

BUT after I zipped it back...

in the templates list it was displayed as a corrupted template...
and Libreoffice couldn't repair it, even though it offered to...


so... there's no easy / manual solution... 

but I think there should be :)
Comment 3 peter josvai 2025-03-02 18:16:19 UTC
SOLUTION!!!!  (archive manager -- linux mint) (3.36.3, archive manager for GNOME)


I have done this (finally):

I copied "my_temp_24.ott"  to another directory.
Right click, open with --- archive manager...


then selectd manifest.xml (by right clicking)
and "open with" again... 

and chose a text editor...


then changed the "<dc:title>" tag's content... to "my_temp_25"


and then closed it..
and chose "update" (meaning updating the content of the compressed file)


AND pasted this file back to the template dir...

and it was there!!!!

and I could open it for editing!!!

...................


my conclusion:
after I pasted back "my_temp_25.ott" to the template directory...
it wouldn't be visible cause it had the same title as another template...

which you can correct by using archive manager (which will re-compress the zip the same way as it was compressed originally) 
and opening the manifest.xml 
and 
editing the <dc:title> tag...
and updating the zip... (the .ott-file)


Now I can handle templates :) 
I wish there was an easier way which anybody could use!

Peter

* * * * *   thank you for developing Libreoffice * * * * *
Comment 4 peter josvai 2025-03-02 18:20:49 UTC
ONE important CORRECTION:

meta.xml

NOT manifest.xml


it was META  .. meta.xml that I was talking about, not the manifest.xml (it has no role in this story :))

sorry!

Peter
Comment 5 Heiko Tietze 2025-12-03 06:04:06 UTC
(In reply to peter josvai from comment #3)
> SOLUTION!!!! 
=> INVALID (no issue)

> I wish there was an easier way which anybody could use!
The documentation might help you https://nextcloud.documentfoundation.org/s/sTfTQ2p6TBMQHRo, including tips for the Template Manager.
Comment 6 Heiko Tietze 2025-12-03 06:05:12 UTC
By the way, you may also discuss the workflow with experts at https://ask.libreoffice.org/