Bug 161925

Summary: templates saving template as template_v2 -- strange behavior
Product: LibreOffice Reporter: peter josvai <jepe>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: trivial    
Priority: medium    
Version: 7.6.7.2 release   
Hardware: All   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:

Description peter josvai 2024-07-06 08:46:10 UTC
Description:
hi, 

I didn't reset the user profile, and I didn't make the experiment that I've written down below. 
What I wrote down, however, is what I actually did and find.

NOTES:
in the template dir (custom template dir, which in my case is DOX-templates) 
I found that some files (.ott) had 644 "right settings) while other 755
(I used midnight commander)

test_temp_2.ott had 644 mod, test_temp_1.ott 755

what I've written down is what actually happened...

BUT I'M CERTAIN that "fiddling" with templates can screw up things big time... 

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

MY aim was:
saving the old template TempName23 as TempNAme24, basically... 

this seemed like a simple idea, and it also seemed to make sense :)


Steps to Reproduce:
1./a assign a folder for your own custom templates in the Path menu;

1./b create 2 templates:
test_temp_1.ott and test_temp_2.ott  (make sure they are easily discernible);

1./c SET  "test_temp_1.ott" (or rather, test_temp_1) as your default

2./a close Libreoffice; 
2./b create a backup copy of that template directory; 
2./c chmod all to 755; 

3. copy test_temp_1.ott over test_temp_2.ott

Actual Results:
Open Writer, and look at the templates (Manage templates)

- no default would be set
- test_temp_2 , when opening, would be (would open) test_temp_1.ott

Expected Results:
the default template would be the same as before

test_temp_2, when opening, would "be" (would open) test_temp_2.ott

test_temp_2.ott would be identical to test_temp_1.ott


Reproducible: Always


User Profile Reset: No

Additional Info:
version 7.6.7.2  X_86 Linux

[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 peter josvai 2024-07-06 08:53:42 UTC
OKAY, I've managed to do do it again!


I shut down Writer,
opened mc (midnight commander)
all files were 755

copied temp_1.ott over temp_2.ott

opened Writer

opened Manage Templates

..............................
results:

temp_2 was gone  (from the list) literally "temp_2" (not temp_2.ott)

as I opened "temp_1", temp_2.ott would open...
Comment 2 peter josvai 2024-07-06 09:10:27 UTC
PS:

md5sume is (not surprisingly) the same of temp_1.ott and temp_2.ott 

- - -

PS 2:

I shut down Libreoffice,
deleted the template dir,
I renamed the backup copy of the template directory to the original name

opened Writer, 
all was well "again"  (I mean, still :))

that is:

there was temp_2 and  temp_1 in the manage templates window...

temp_1 would open temp_1.ott, and temp_2 temp_2.ott

- - -


PS 3:

I've done this several times...
also withOUT changing the file rights all to 755


ALWAYS the same result:

temp_2 disappears, 
and temp_1 opens temp2.ott
Comment 3 peter josvai 2024-07-06 10:05:56 UTC
PS 4:

the task I wanted to perform is to SAVE a template under a new name, as a new template...

This can be actually performed totally easily:


open temp_1 --> it will open temp_1.ott

then save as template: name: temp_2

and after this, you'll have two templates in the template window:

temp_1 and temp_2

both opening the respective .ott file (temp_1.ott, temp_2.ott)

in Midnight Commander you'll find both files to be the exact same file size

and guess what!!!
the md5sum of the two files would be the same!!


======================

So what is wrong with all this, if anything?

Well, if anything...
then  cloud syncing...

cause when you move to your other machines, the newly created template wouldn't be there....


+ + + + + + + + + + + + +
BUT guess what!!!! :)

using koofr as a sync system, I walked over to the other machine, 
and temp_2 was in the templates list...
and it would open temp_2.ott

which would have the same md5sume value :)



CONCLUSION:
I can't even imagine how this is done :)

but WORKS, I repeat, works!!! well beyond what's expected by me :)